Data Structures / Transformations

Started by
0 comments, last by UStink2Me 24 years, 6 months ago
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.

Thanx

Advertisement

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).

e.g.
typedef struct
{
int m[3][3];
int t[3];
} DRAW_MATRIX;

This topic is closed to new replies.

Advertisement