H.Stony

05-08-2005, 12:42 AM

i have to recalculate the position of an object after transformation.

First Method:

pseudocode:

"Camera" transformations

push the matrix

object transformations

draw the object

pop the matrixto get the correct position of a transformed point i need to call "glLoadIdentity" so i have to take a second pass:

glPushMatrix();

glLoadIdentity();

Same transformations as above;

getTheMatrix();

glPopMatrix();Second Method:

"Camera" transformations

write the modelview in an array

push the matrix

load the identity

object transformations

get the modelview to recalculate a point

multiplicate the current matrix with the cameramodelview.

Load the new matrix

draw the object

pop the matrixBoth ways would work but which one is the faster one? is glMultMatrix slow?

hope you understand my problem. i hope someone has tested it or has experience with such performance questions.

thanks

First Method:

pseudocode:

"Camera" transformations

push the matrix

object transformations

draw the object

pop the matrixto get the correct position of a transformed point i need to call "glLoadIdentity" so i have to take a second pass:

glPushMatrix();

glLoadIdentity();

Same transformations as above;

getTheMatrix();

glPopMatrix();Second Method:

"Camera" transformations

write the modelview in an array

push the matrix

load the identity

object transformations

get the modelview to recalculate a point

multiplicate the current matrix with the cameramodelview.

Load the new matrix

draw the object

pop the matrixBoth ways would work but which one is the faster one? is glMultMatrix slow?

hope you understand my problem. i hope someone has tested it or has experience with such performance questions.

thanks