Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
www.jpct.net
»
jPCT-AE - a 3d engine for Android
»
Support
»
Calculating rotation angle
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Calculating rotation angle (Read 3063 times)
gamerfan
int
Posts: 97
Calculating rotation angle
«
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
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: Calculating rotation angle
«
Reply #1 on:
September 08, 2011, 09:33:30 am »
The angle between...what? I'm not sure what you mean with "rotation angle for every point"?
Logged
gamerfan
int
Posts: 97
Re: Calculating rotation angle
«
Reply #2 on:
September 08, 2011, 09:42:01 am »
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?
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: Calculating rotation angle
«
Reply #3 on:
September 08, 2011, 09:51:33 am »
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.
Logged
gamerfan
int
Posts: 97
Re: Calculating rotation angle
«
Reply #4 on:
September 08, 2011, 10:55:12 am »
Thanks it worked.I used box.getTransformedCenter().calcAngle(box.getXAxis()) this will return angle swept by the rotation
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
www.jpct.net
»
jPCT-AE - a 3d engine for Android
»
Support
»
Calculating rotation angle