Transform3D getInvTransform() { if (invTransform == null) { invTransform = new Transform3D(transform); invTransform.invert(); } return invTransform; }
/** * This method sets the axis of transform for this interpolator. * @param axisOfTransform the transform that defines the local coordinate * system in which this interpolator operates */ public void setTransformAxis(Transform3D axisOfTransform) { this.axis.set(axisOfTransform); this.axisInverse.invert(this.axis); }
public void getTransformInverse(final Transform3D transform) { getTransform(transform); transform.invert(); }
/** * Multiplies transform t1 by the inverse of transform t2. The final * value is placed into this matrix (this = t1*t2^-1). * @param t1 the left transform in the multiplication * @param t2 the transform whose inverse is computed. */ public final void mulInverse(Transform3D t1, Transform3D t2) { Transform3D t3 = new Transform3D(); t3.autoNormalize = false; t3.invert(t2); this.mul(t1,t3); }
private void getCoexistenceToViewPlatform(CanvasInfo ci) { if (ci.updateCoeToViewPlatform) { if (verbose) System.err.println("updating CoeToViewPlatform") ; if (ci.coeToViewPlatform == null) ci.coeToViewPlatform = new Transform3D() ; getViewPlatformToCoexistence(ci) ; ci.coeToViewPlatform.invert(ci.viewPlatformToCoe) ; ci.updateCoeToViewPlatform = false ; if (verbose) t3dPrint(ci.coeToViewPlatform, "coeToVp") ; } }
/** * Multiplies this transform by the inverse of transform t1. The final * value is placed into this matrix (this = this*t1^-1). * @param t1 the matrix whose inverse is computed. */ public final void mulInverse(Transform3D t1) { Transform3D t2 = new Transform3D(); t2.autoNormalize = false; t2.invert(t1); this.mul(t2); }
@Override public void pressed(SensorEvent e) { initAction(e.getSensor()) ; // Save the inverse of the initial sensorToVworld. initialVworldToSensor.invert(sensorToVworld) ; }
Transform3D getNormalTransform() { if (normalTransform == null) { normalTransform = new Transform3D(transform); normalTransform.invert(); normalTransform.transpose(); } return normalTransform; }
private void computeObjCoord(Canvas3D canvas, Point2d winCoord, Point3d objCoord, Transform3D localToImagePlate) { // Back transform this pt. from window to object coordinates // Assumes this method is ALWAYS called after computeWinCoord has been // called. computeWinCoord calculates the Vworld to Image Plate Xform. // This method simply uses it without recomputing it. canvas.getPixelLocationInImagePlate(winCoord.x, winCoord.y, objCoord.z, objCoord); // Get image plate to object coord transform // inv(P x M) localToImagePlate.invert(); localToImagePlate.transform(objCoord); }
boolean intersect(Transform3D thisLocalToVworld, Transform3D otherLocalToVworld, GeometryRetained geom) { Transform3D t3d = new Transform3D(); t3d.invert(otherLocalToVworld); t3d.mul(thisLocalToVworld); return intersect(t3d, geom); }
final void volumeToIP(final Canvas3D canvas, final Transform3D ret) { canvas.getImagePlateToVworld(ret); ret.invert(); rootBranchGroup.getLocalToVworld(toVWorld); ret.mul(toVWorld); }
Transform3D getVworldToVpc() { if (vworldToVpc == null) vworldToVpc = new Transform3D(); vworldToVpc.set(getCurrentLocalToVworld(null)); vworldToVpc.invert(); return vworldToVpc; }
private Transform3D getNormalTransform() { if (compTransform.isRigid()) { return compTransform; } if (normalTransform == null) { normalTransform = new Transform3D(); } if (normalTransformNeedToUpdate) { normalTransform.invert(compTransform); normalTransform.transpose(); normalTransformNeedToUpdate = false; } return normalTransform; }
private void getTrackerBaseToViewPlatform(CanvasInfo ci) { if (ci.updateTrackerBaseToViewPlatform) { if (verbose) System.err.println("updating TrackerBaseToVp") ; if (ci.trackerBaseToViewPlatform == null) ci.trackerBaseToViewPlatform = new Transform3D() ; getViewPlatformToCoexistence(ci) ; ci.trackerBaseToViewPlatform.mul(coeToTrackerBase, ci.viewPlatformToCoe) ; ci.trackerBaseToViewPlatform.invert() ; ci.updateTrackerBaseToViewPlatform = false ; if (verbose) t3dPrint(ci.trackerBaseToViewPlatform, "TrackerBaseToViewPlatform") ; } }
boolean intersect(Transform3D thisLocalToVworld, Bounds targetBound) { Bounds transBound = (Bounds) targetBound.clone(); Transform3D t3d = new Transform3D(); t3d.invert(thisLocalToVworld); transBound.transform(t3d); return intersect(transBound); }
TransformGroup viewingTransformGroup = simpleUniv.getViewingPlatform().getViewPlatformTransform(); Transform3D viewingTransform = new Transform3D(); Point3d eye = viewersLocation; Point3d center = gazePoint; Vector3d up = new Vector3d(0,1,0); //assumes +y-axis points up viewingTransform.lookAt(eye, center, up); viewingTransform.invert(); viewingTransformGroup.setTransform(viewingTransform);
private void volumeToImagePlate(final Canvas3D canvas, final Transform3D volToIP) { canvas.getImagePlateToVworld(volToIP); volToIP.invert(); final Transform3D toVWorld = new Transform3D(); node.getLocalToVworld(toVWorld); volToIP.mul(toVWorld); }
/** * Calculates where the specified point in the vworld space is placed on the * canvas and stores the result in the specified Point2d. * * @param in * @param out */ public void pointInCanvas(final Point3d in, final Point2d out) { tmpP.set(in); canvas.getImagePlateToVworld(ipToVWorld); ipToVWorldInverse.invert(ipToVWorld); ipToVWorldInverse.transform(in); canvas.getPixelLocationFromImagePlate(in, out); }
Transform3D lookAt = new Transform3D(); lookAt.lookAt( new Point3d( 0.0, 0.0, 1.0 ) , new Point3d( 0.0, 0.0, 0.0 ) , new Vector3d( 0.0, 1.0, 0.0) ); lookAt.invert();
private static Point3d getViewPosInLocal(final View view, final Node node) { if (node == null) return null; if (!node.isLive()) return null; // get viewplatforms's location in virutal world final Canvas3D canvas = view.getCanvas3D(0); canvas.getCenterEyeInImagePlate(viewPosition); canvas.getImagePlateToVworld(t); t.transform(viewPosition); // get parent transform node.getLocalToVworld(parentInv); parentInv.invert(); // transform the eye position into the parent's coordinate system parentInv.transform(viewPosition); return viewPosition; }