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

Data Structures / Transformations

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