11-03-2003, 11:00 AM

In my code, I use about 20 different transformations(translation, rotation, scaling)for a few points. I don't want to do all the matrix arithmetic because 1. it takes too much CPU power 2. I don't know where all the operations are. Is there any way to get the value of a point by getting your modelview matrix from glGetFloatv()?

Basically, let's say that I have the identity matrix:

glTranslatef(-5.0f,2.0f,3.0f);

glRotatef(30,1,0,0);

glTranslatef(0.0f,0.0f,1.0f);

glScalef(2.0f,1.0f,1.0f);

Now I want to get the point of the origin on this matrix:

x = getx(0);

y = gety(0);

z = getz(0);

How would I create these 3 functions?

Basically, let's say that I have the identity matrix:

glTranslatef(-5.0f,2.0f,3.0f);

glRotatef(30,1,0,0);

glTranslatef(0.0f,0.0f,1.0f);

glScalef(2.0f,1.0f,1.0f);

Now I want to get the point of the origin on this matrix:

x = getx(0);

y = gety(0);

z = getz(0);

How would I create these 3 functions?