Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ghost image while tracking

4 views
Skip to first unread message

me_...@yahoo.com

unread,
Dec 3, 2007, 9:36:15 AM12/3/07
to
Hi,
I'm pretty new to Java3d, and I am having trouble trying to figure out
how to prevent an unwanted ghost image from appearing in my scene. In
my behavior, I am adjusting the location and position of an object
that I am tracking from my view, and I also adjust the the view to
look at the new location of the object. Java3D first renders the
object in its new position and orientation using the old view config,
then it is redrawn again using the new view config (which is always
centered on the screen and is what I want). The result of this is a
ghost trail as the object moves and is tracked.

What is the correct approach to have my behavior do all object and
view updates before rendering? Do I need to do offscreen rendering to
fix this?
Thanks

Zaxonic

unread,
Mar 7, 2008, 11:47:09 PM3/7/08
to

I would highly suggest that you use something other than Java 3D if
you can at all help it. It is no longer supported by the Java
community (or even Sun) it seems. jME (J Monkey Engine) is a decent
alternative and there are a few other alternatives you can look at.

Mark Hood

unread,
Mar 10, 2008, 9:40:18 PM3/10/08
to
Weird... you replyed to a post from over a year ago.

Anyway, abandoning Java 3D is an option and makes sense over the long
term, but it might not be the best option short term if one has a lot
of code invested in it, especially when a fix for a specific problem
is available and well-known:

Java 3D has a 1-frame latency between the view parameters currently in
use by the renderer and the scene graph view platform position that
the application sets. So if you take the view parameters from
something like Canvas3D's ImagePlateToVworld and align some geometry
in the scene graph to it, it will end up being 1 frame behind the
actual view by the time the scene graph is actually updated by the
system.

The ViewInfo utility class (somewhere in com.sun.j3d.utils.universe)
will give you view info that is up-to-date with respect to the current
state of the scene graph.

-- Mark

Joyal

unread,
Mar 11, 2008, 10:44:19 AM3/11/08
to
maybe when you move the object , you dont multiply the matrix of the
Transform Group , and it change the position, or maybe im wrong xD

i give a example:

ColorCube cube=new ColorCube();

BranchGroup modelObj=new BranchGroup();
TransformGroup trasnformModel=new TransformGroup();
TransformGroup rotateModel=new TrasnformGroup();

rotateModel.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
rotateModel.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
rotateModel.addChild(cube);

transformModel.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
transformModel.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
transformModel.addChild(rotateModel);

modelObj.addChild(transformModel);

//Transform to Move the object and rotate
Transform3D t3d= new Transform3D();
Transform3D t3dRot= new Transform3D();
Transform3D t3dMov= new Transform3D();

//Movement
t3dMov.setTranslation(new Vector3d(0.0f,0.0f,1.0f));
t3d.mul(t3dMov);
transformModel.setTransform(t3d);

//Rotate all the object
t3dRot.rotX(x);
t3d.mul(t3dRot);
transformModel.setTransform(t3d);


//New Transform to Rotate the object but doesnt change his egde
Transform3D t3d2= new Transform3D();
Transform3D t3dRot2= new Transform3D();

//Rotate the object but in the same edgde
t3dRot2.rotZ(z);
t3d2.mul(t3dRot2);
rotateModel.setTransform(t3d2);


i hope it's help you! :)

pd: sorry my english

0 new messages