Jump to content
  • Advertisement


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


glMultiMatrix - Rotation/Translation alternative?

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

Hi. I''m currently in the process of porting my insect based crowd simulation from a standard OpenGL drawing function which I wrote to the Ogre Graphical Engine (www.ogre3d.org). Now in the current implementation, I simply give OpenGL a matrix which looks like this :
 forward.x forward.y forward.z    0
    side.x     side.y     side.z  0
      up.x       up.y       up.z  0
position.x position.y position.z  1

(or whatever) So each insect ''agent'' updates its forward, side, up and position each frame using Euler Ingeration. Now Ogre (AFAIK) doesn''t have an equivilent function I can pass the orientation matrix to...so I need to do it manually... Can anyone tell me / put me on the right track as to how I would do this? I imagine it can be done with rotations/translations... Cheers, SFA.

Share this post

Link to post
Share on other sites
i think you are doing you matrix math wrong..
you have do each transformation on an Identity matrix then
multipy to get your final transform mat.

this is from memory so,

Translation Matrix:

| 1 0 0 x |
A = | 0 1 0 y |
| 0 0 1 z |
| 0 0 0 1 |

Rotation Matrix (Rotation about Y of angle ''Q''):

| cos Q 0 sin Q 0 |
B = | 0 1 0 0 |
| -sin Q 0 cos Q 0 |
| 0 0 0 1 |

your final matrix you pass to Ogre will just be
[ A times B ]

hope that helps.

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!