How to read back transformed coordinates
Is it possible in the OpenGL API to transform (rotate) a point and then save the result? I don't just want to apply rotations for rendering with glRotatef. I want to rotate a point and then save the result.
Or do I just need to build my own rotation functions for this?
On SM4 hardware, that should be possible with "transform feedback", but I would think twice (actually... thrice) before using it.
Rotating some points (if that's all you need) is really a lot easier by using standard rotation functions (possibly paired with translation). It's something that works out of the box and pretty much "for free". Or, compose your own matrix and feed that to the GL.
Doing your own rotation math will work too, and it will probably be a lot easier than transform feedback, too (and won't require newest generation hardware).
Rotating some points (if that's all you need) is really a lot easier by using standard rotation functions (possibly paired with translation). It's something that works out of the box and pretty much "for free". Or, compose your own matrix and feed that to the GL.
Doing your own rotation math will work too, and it will probably be a lot easier than transform feedback, too (and won't require newest generation hardware).
Why would you want to do that? Are you intending to use OpenGL to compute stuff you need in your game logic? If that's the case, it probably is better to write your own routines.
Quote:Original post by SnotBob
Why would you want to do that? Are you intending to use OpenGL to compute stuff you need in your game logic? If that's the case, it probably is better to write your own routines.
Yes, that's what I wanted to do. I just wrote my own routines based on these replies. Thanks.
Yes, you need a math library
Here, they mention a lot of libs. There is one called MathGL++
http://www.gamedev.net/community/forums/topic.asp?topic_id=291432
Here, they mention a lot of libs. There is one called MathGL++
http://www.gamedev.net/community/forums/topic.asp?topic_id=291432
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement