Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

IamQwerty

Please Help me... Rotation Prob...

This topic is 6622 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a space ship rotation problem if someone think they can help me... Mail me and I send you the code... what I am Trying to do i a space ship simulator whit "realistic" controls .... i can''t Get the Rotation to work properly... Please Help... /* joho_iamqwerty@hotmail.com */

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
what kind of rotation are you trying to do....
is it DirectX or....
does your graphics device support rotation ?

Share this post


Link to post
Share on other sites
If its 2d rotation, look at my game, http://arkia.tripod.com. It is a 2d space game and it does rotation.

For a good time hit Alt-F4! Go ahead try it, all the cool people are doing it.

Share this post


Link to post
Share on other sites
The problem with using angles for each axis to rotate a ship is commonly known. No matter what order you rotate in, the second rotation will be relative to the first, and the third relative to the first and second. The first rotation is always relative the world axis. I think the solution is to use quanterions, but I don''t know anything about them.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Its not too hard.
just forget about the 4th row in the vector - keep it 1.
In OpenGl the current Modelview Matrix is applied to the verticies like that:

v'' = M * v (v={x,y,z,1})

so, to solve your problem you have to apply the Rotation R from the _left_ side:

v" = R * M * v

Then you will rotate in ''screen'' coordinates.
If you use glRotate/glTranslate it would be like that:

v"= M * R * v

which means, that you are rotating in the local system :-(

I solved the problem like that:
I implemented a CMatrix class which holds an float[16] Matrix and some memberfunctions to create the rotation matricies and the matrix multiplications.
In my application i start with an identity matrix and then modify it for each rotation.
Before calling the Rendering functions i load my own rotation matrix...

...long enough for here...

Syn

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!