I am challenging conversion from Canvas3D coordinates to
VirtualWorld coordinates.
and I want to draw lines using MouseDragg on the plane of
XY(for example, Z=0.0).
When SimpleUniverse is used and the viewpoint is automatically set
(using universe.getViewingPlatform().setNominalViewingTransform()),
X and Y coordinates for Z=0.0 can be obtained because of the following
conversion.
(I referred to generatePickRay() of PickObject())
public Point3d get3Dpoint(Canvas3D canvas, int xpos, int ypos){
Transform3D motion = new Transform3D();
Point3d mousePosn = new Point3d();
canvas.getPixelLocationInImagePlate(xpos,ypos,mousePosn);
canvas.getImagePlateToVworld(motion);
motion.transform(mousePosn);
return mousePosn;
}
But, The drawing position shifts when the aspect is moved in the direction of Z.
I wonder whether there is something good improvement method.
Mitsuru Tsukiyama
