PDA

View Full Version : How to tell where the points are if i rotate something?



Josh Kasten
04-08-2003, 11:22 PM
lets say i draw a tri then rotate it how would i tell there the points of the tri are by just doing opengl commands?

ben
04-09-2003, 01:51 AM
- You can use the gluProject function to project the vertex positions into window coordinates.

- You might be able to use the ogl feedback mechanism to get vertex positions. I forget exactly what info you can get from feedback.

vincoof
04-09-2003, 02:17 AM
Originally posted by ben:
I forget exactly what info you can get from feedback.
Vertex position, color and texture coords (I think it is limited to single-texturing but not sure).
You can take a look at OpenGL specifications for details.

Feedback ensures that the transformation exactly corresponds to what OpenGL computes, whereas gluProject is just an approximation (though the approximation is "almost" perfect).

The feedback buffer clips the vertex coordinates to the viewing frustum. Be careful if the model you're rendering does not lie entirely within the viewport.

[This message has been edited by vincoof (edited 04-09-2003).]