Jump to content
  • Advertisement


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


Data Structures / Transformations

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

How do 3D engines deal with objects/ entities (i.e. monsters, crates, etc.)? Since objects/entities need to maintain their own origins (is this right?) for rotations and animations, does this mean that each objcet/entity will have to have its own transformation matrix associated with it? And if so, what type of data structure would you suggest using to store this information?

I hope I'm not way off base with this question. I am fairly new to all of this and am just trying to grasp some of the concepts. Thanks.


Share this post

Link to post
Share on other sites
Guest Anonymous Poster

Yes, you generally have an object in its own local space and store a matrix for each object that specifies its orientation/position in the world.
You need to store 16 numbers, a 4x4 matrix which gives orientation and world position. However, you can assume the bottom row of your matrix is (0,0,0,1) and reduce the storage to just 12 numbers (the 3x3 rotation and the 3-vector world position).

typedef struct
int m[3][3];
int t[3];

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!