www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: fireside on October 14, 2010, 05:05:14 am

Title: absolute translation
Post by: fireside on October 14, 2010, 05:05:14 am
I've forgotten how to do an absolute translation.  It's basically a relative motion, so how do I do that when the object is not at the point of origin?  Rotation doesn't matter in this case.  I just need to either get it back to the origin or compensate somehow.
Title: Re: absolute translation
Post by: EgonOlsen on October 14, 2010, 07:02:09 am
Code: [Select]
obj.clearTranslation();
obj.translate(...);
Title: Re: absolute translation
Post by: fireside on October 14, 2010, 07:14:19 am
Thanks.
Title: Re: absolute translation
Post by: Socke on November 26, 2012, 07:49:23 pm
And with rotation?

I need the position and rotation for network play.

I try object.getTranslationMatrix() -> network -> object.setTranslationMatrix() but this not work.

I think object.getTranslation() -> network -> object.clearTranslation() -> object.translate() work (not tested) but how send the rotation?
Title: Re: absolute translation
Post by: EgonOlsen on November 26, 2012, 08:53:05 pm
As a matrix. You can get and set the rotation matrix.