#### Archived

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

# matrix issue...

This topic is 5350 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a linked list system for the entities. Im using glLoadMatrix along with my math class to handle transformations. Im sure this is a trivial question.. Anyway, I added a terrain to the scene graph as the root node and then attached a child entity to the terrain. When I try and move around in the world, nothing happens. So, this is really 2 questions in 1. first off, if your using glLoadmatrix, can you still move the object around using gltranslate/rotate? glTranslatef(cam...) ... DrawObject(); //load matrix is in this function... 2: (vague) is this correct?... child entitie's matrix code (example)
glPushMatrix();
mpTransform.SetTranslation(mpPosition); //vector function

mpTransform.SetRotation(mpRotation);
glMultMatrix(mpTransform);
...

Does anyone see what im doing wrong? (note that I have tried switching mpParent->mpTransform to multmatrix, but no change). Im relatively new to using glLoadMatrix to handel transformations, ive always used glTranslate/rotate before this. Thanks a lot in advance guys! ~No1 [edited by - no one on February 21, 2004 4:11:15 AM]

##### Share on other sites
A glMultMatrix call multiplies the current matrix by the matrix you pass. A glLoadMatrix call replaces the current matrix with the matrix you pass. The glTranslate, glRotate and glScale commands are special cases of glMultMatrix, so they multiply the current matrix by a matrix built from the arguments you pass. Therefore if you call glTranslatef and then glLoadMatrix the load matrix call will replace the existing matrix and the glTranslatef call will have no effect.

Enigma

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 13
• 19
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
632929
• Total Posts
3009287
• ### Who's Online (See full list)

There are no registered users currently online

×