Hi, all:
I created a Sphere, and I can drag it as I wish.
The code is like:
Sphere sphs = new Sphere(0.02f, someAppearance);
TramsformGroup sphTrans = new TransformGroup();
sphTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
sphTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
sphTrans.setCapability(Group.ALLOW_CHILDREN_EXTEND);
sphTrans.setCapability(Group.ALLOW_CHILDREN_READ);
sphTrans.setCapability(Group.ALLOW_CHILDREN_WRITE);
sphTrans.addChild(sphs);
I would like to obtain two things:
-
the new coordinate of this “sphs” after I dragged the 3D object randomly.
In my application now, after some rotation and translation, “sphs” changes its position on the screen image, however, it looks its 3D coordinate didn’t change at all. So, does that mean, the 3D coordinate won’t change even if I dragged it around?? -
How to obtain the 2D onScreen projection coordinates after 3D transformation?
For sure, the 2D on screen coordinate of this “sphs” varies all the time. How can I obtain the dynamic 2D projection coordinates of this “sphs”
Thanks in advance.
Best Regards
JIA
Best Regards
JIA Pei