# Get Coordinates of Transformed Geometry

Get Coordinates of Transformed Geometry?

Example:

glPushMatrix();
glRotatef(55,1.0,0.0,0.0);
glBegin(GL_POINTS);
glVertex3f(x,y,z);
glEnd();
glPopMatrix();

So how can I get the Coordinates of my rotated vertex? is this possible or do i have to calculate the position myself (would be very slow)?

thank you H.Stony

sorry…i found nothing really useful
i found something about “feedback mode”. are there tutorials on it?

thanks

I’m not sure, but maybe if you multiply the coordinates of the vertex by the rotated modelview matrix…

that was also my first idea: which are the elements in the matrix to multiplicate? the last row? …but
i found a sgi example. in the example they use the feedback mode but i didn’t find tutorials on it - only the example is hard to understand.

First retrieve the current modelview matrix:

float mv;
glGetFloatv(GL_MODELVIEW_MATRIX, mv);

Then do the following to transform your vertex:

float xp = mv * x + mv * y + mv * z + mv;
float yp = mv * x + mv * y + mv * z + mv;
float zp = mv * x + mv * y + mv * z + mv;
float wp = mv * x + mv * y + mv * z + mv;

xp /= wp;
yp /= wp;
zp /= wp;

/A.B.

thank you