www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Kaiidyn on November 23, 2010, 03:23:53 pm

Title: Rotating Object
Post by: Kaiidyn on November 23, 2010, 03:23:53 pm
When using Object3D.rotateX the object rotates the object with the value given.
Is it possible to do like Object3D.rotateX(Math.toRadians(45)); in the renderloop and keep the object rotated at 45 degrees, instead of adding 45 deg. to the current rotation value?

Edit: Also is it possible to get the current rotate value?
Title: Re: Rotating Object
Post by: EgonOlsen on November 23, 2010, 08:52:36 pm
You can clear the rotation in each iteration and re-set it to 45° (or whatever afterwards). Object3D.clearRotation() is your friend. About the second question: Yes and no...all rotations accumulate to a matrix. You can get some euler angles back from that one (the forum should actually contain various code for this), but there's no guarantee that they'll match the ones that you used to create the matrix. If you really need this, it's a better idea to keep track of the angles yourself IMHO.
Title: Re: Rotating Object
Post by: Kaiidyn on November 23, 2010, 10:55:21 pm
Awesome, got it working now :)
thanks mate