Calculating rotation angle

Started by gamerfan, September 08, 2011, 09:29:27 AM

Previous topic - Next topic

gamerfan

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

EgonOlsen

The angle between...what? I'm not sure what you mean with "rotation angle for every point"?

gamerfan

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?  :)

EgonOlsen

You can use this method: 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.

gamerfan

Thanks it worked.I used box.getTransformedCenter().calcAngle(box.getXAxis()) this will return angle swept by the rotation