The JavaScript class for converting position from one coordinate system to another. Obtain it as a parameter to the WidgetBase drag signals.
More...
The JavaScript class for converting position from one coordinate system to another. Obtain it as a parameter to the WidgetBase drag signals.
function onDragStart(context)
{
var projectedPoint = context.projectToModelPlane(context.dragPoint());
var modelPickingPoint = context.multiplyByPostMatrix(projectedPoint);
drag_offset = modelOriginPoint.minus(modelPickingPoint);
}
function onDragStartZ(context)
{
context.transformModelMatrix(planeRotation);
var projectedPoint = context.projectToModelPlane(context.dragPoint());
context.transformModelMatrix(inversePlaneRotation);
var modelPickingPoint = context.multiplyByPostMatrix(planeRotation.multiply(
Point3d(projectedPoint.x, projectedPoint.y, 0)));
drag_offsetZ = modelOriginPoint.minus(modelPickingPoint);
}