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; }
/** * return the eye's position in <node>'s coordinate space */ 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; }