Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Data Structures / Transformations


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 UStink2Me   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 November 1999 - 12:20 PM

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



Sponsor:

#2 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 03 November 1999 - 12:20 PM


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;






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS