Sign in to follow this  
vaironl

[XNA] rotation question

Recommended Posts

vaironl    128
hello Guys vaironl here. I was doing a rotation part in Riemers XNA tutorial about rotation and it tells me to put this line
[code]Matrix rotMatrix = Matrix.CreateRotationZ(rocketAngle);[/code]

and I just don't understand why do we need to create a rotation around the Z axis instead of the X axis.

[url="http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2D/Angle_to_Direction.php"]Reimers Angle to Direction[/url]

Share this post


Link to post
Share on other sites
christopherg    124
In the tutorial, the rocket is flying in the X direction.
So, to make the rocket pitch up and down in that direction, you need to rotate AROUND the Z axis.

This little picture might help ([url="http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drotz.gif"]Link[/url])
Notice how rotating around the Z axis will make the rocket pitch up or down in the X direction.
If you rotated around the X axis the rocket would just spin! (or something close enough to that for this discussion)

Share this post


Link to post
Share on other sites
vaironl    128
[quote name='Christopher G.' timestamp='1310979446' post='4836721']
In the tutorial, the rocket is flying in the X direction.
So, to make the rocket pitch up and down in that direction, you need to rotate AROUND the Z axis.

This little picture might help ([url="http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drotz.gif"]Link[/url])
Notice how rotating around the Z axis will make the rocket pitch up or down in the X direction.
If you rotated around the X axis the rocket would just spin! (or something close enough to that for this discussion)
[/quote]

Got it I was thinking about that yesterday, since the Z is sticking out of the screen. Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this