Jump to content
  • Advertisement

Archived

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

no one

transformations...

This topic is 5277 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

Hiya Im a bit confused about quaternions and matracies. Im working on a game right now and im trying to figure out the best way to do transformations. In the past, I simply used two 3d vectors, one for translation and one for rotation (im using OpenGL btw). I need to add a camera class and I want to create a "movement" class to make handeling physics and well characer movement easier, but im not sure rather I should use quaternion based rotation, a matrix, or plain old vectors. (btw, I have made a complete class for all three.) The only reason I can see using matracies is better then standard 3d vectors is that it makes it easier when adding children and calculating there offset positions. The game will be an overhead rpg, no 6 dof. So I really think quaternions would be overkill since there used to avoid gimble lock. I don''t know what Im trying to ask here, I guess what should I do in which situation like with children entities and such... Thanks a ton for any comments/advice. Oh, the movement class, If I wanted to use this to handle physics, what may I want to add to it (say if I want to add car physics and such)? Thanks again. Lost and Confused...damned blonde hair! lol ~Jason

Share this post


Link to post
Share on other sites
Advertisement
Im not sure if I quite understand the question but here goes anyway. For a camera I would definately use quaternions because not only do they avoid gimbol lock (as you say) but interpolating between two view points and angles using quaternions leads to a much smoother and more natural motion. To represent the orientation of game objects you need to way up several factors. Quarternions take up less space (4 paramaters compared to a matricies 9) and are less computationaly expensive. However matricies have the advantage that they can be concatenated which is extremely useful and saves much computation if you have object hierarchies. Hence if your''re using parent objects with many children I''d use matricies for them. Also matricies are easier on the brain Hope this helps

Share this post


Link to post
Share on other sites
Cool, Thanks a lot. Im going to write a quaternion based camera class and use matracies for my objects since I am using a hierarchy system for the objects (parents and children). About matracies, I have a 4x4 matracie class, would you recommend using a 3x3 instead?

Share this post


Link to post
Share on other sites
quote:
Original post by no one
About matracies, I have a 4x4 matracie class, would you recommend using a 3x3 instead?

It depends on whether you want to include a translation transformation in your matrices. But if you are only going to use your matrices for rotation and/or scaling, then using 3x3 matrices would save some memory.

Share this post


Link to post
Share on other sites
Why is good using 4x4 matrices. Isn''t it cheaper to use 3x3 matrices, and use a translation vector. There are a lot of unnecessary zero element in the 4x4 matrix. Or is there a fast multiplication algorithm for it? 3x3 mult. = 9 mult, 4x4 mult. = 16 mult., it''s almost twice more.
So when you want to transform with this matrix during displaying, you just create a 4x4 matrix from the the 3x3 matrix and translation vector and use that. In OpenGL it is simple, although I haven''t used it yet.

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!