Get Coordinates of Transformed Geometry
an example:
glPushMatrix();
glRotatef(39,1.0,0.0,0.0);
glBegin(GL_POINTS);
glVertex3f(x,y,z);
glPopMatrix();
how do i get the position of the vertex? i don't want to use own algorithm for this (performance)
you cant, once a vertex goes down the pipeline its lost to you, the only way to work it out is to pull back the modelview matrix and perform the maths yourself
i heard something about "feedback" mode. does anybody know an example/tut?
if this doesn't work: how do i have to multiplicate my vertex with the transformed modelview elements?
thanks
if this doesn't work: how do i have to multiplicate my vertex with the transformed modelview elements?
thanks
Sure you can, by using the feedback rendering mode. Check out glRenderMode and glFeedbackBuffer.
However, this is not the fastest way to do it, so performancewise, doing it yourself is likely to be faster. Just because OpenGL can do it for you doesn't mean it can do it faster than you can.
However, this is not the fastest way to do it, so performancewise, doing it yourself is likely to be faster. Just because OpenGL can do it for you doesn't mean it can do it faster than you can.
the problem is:
i have to rotate a vehicle round strange axis and a recalculation is really terrible
okay. i will check feedback rendering mode out
thanks
i have to rotate a vehicle round strange axis and a recalculation is really terrible
okay. i will check feedback rendering mode out
thanks
Given a point, you can perform all transformations on it, then read back the modelview matrix.
The transformed point will reside in the 12,13 & 14 elements of the retrieved modelview matrix.
The transformed point will reside in the 12,13 & 14 elements of the retrieved modelview matrix.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement