shape points position after move

View: New views
3 Messages — Rating Filter:   Alert me  

shape points position after move

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am trying to move object loaded from obj. My scene graph is
locale <- BranchGroup <- TransformGroup <- BranchGroup from Obj <- shape
I move with TG (TransformGroup), works fine. But problem is, when I want to get point coordinates from shape, it still remains the same (coordinates before transformation are the same as after transformation). I guess that I need to use getLocalToVworld to all points from shape, but I have no idea how to do this properly. Maybe I do not need TG, but I have to move with points.

Please advice me. You will be one step closer to be an angle :)
[Message sent by forum member 'ende' (vitezslav.papiez@...)]

http://forums.java.net/jive/thread.jspa?messageID=370846

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: shape points position after move

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

If you need to move an object, or rotate it, scale it,  etc, you just need to apply a Transform3D with correct transform operations.  See Java3D tutorials about Transform

If you need to display the transformed coordinates, then you need  getLocalToVworld and multiply your coordinates with it:

[code]
// Below code must be inside a behavior class.

// t3d comes from somewhere
Transform3D t3d = (...)

// get all  transform accumulated  from root to here
myShape.getLocalToVworld(t3d);

//myShape.getLocalToVworld(sceneGraphPath, t3d);

(...)
// update the transformed points
// I assume you have the coordinates previously stored elsewhere
t3d.transform(Point3d point, Point3d pointOut) ;
[/code]

I hope it helps ;)
[Message sent by forum member 'zesharp' (zando.silva@...)]

http://forums.java.net/jive/thread.jspa?messageID=370857

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: shape points position after move

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thanks man.
[Message sent by forum member 'ende' (vitezslav.papiez@...)]

http://forums.java.net/jive/thread.jspa?messageID=370978

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...