www.jpct.net
jPCT-AE - a 3d engine for Android => Support => Topic started by: gamerfan on September 08, 2011, 09:29:27 am
-
Hi,
I am rotating a box and want to calculate the rotation angle for every point that it rotates in 3d world.The box rotates on Y-axis.How can I do that? Thanks in advance
-
The angle between...what? I'm not sure what you mean with "rotation angle for every point"?
-
The box rotates on y-axis.so every time when I press a key it rotates on y-axis. At that point can we know how much angle swept by this 'rotation'.Is it clear now? :)
-
You can use this method: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/SimpleVector.html#calcAngle(com.threed.jpct.SimpleVector) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/SimpleVector.html#calcAngle(com.threed.jpct.SimpleVector)) to calculate the angle between (0,0,1) and box.getZAxis(). However, try to avoid working with angles if possible. Matrices are far superior.
-
Thanks it worked.I used box.getTransformedCenter().calcAngle(box.getXAxis()) this will return angle swept by the rotation