PDA

View Full Version : rotating and keeping coordinates



Rajveer
04-10-2002, 06:20 AM
I have a bunch of coordinates that I've used to draw a polygon centered around the origin: If I rotate the polygon a certain number of degrees about the origin, those coordinates will all move to new spots. I would like to know the values of the new coordinates after rotation has occured. Can OpenGL do this, or does it have to be done mathematically?

04-10-2002, 08:33 AM
Originally posted by Rajveer:
I would like to know the values of the new coordinates after rotation has occured. Can OpenGL do this?

If you define a rotation, OpenGL will display the next objects rotated by that amount you specified, but you can't get the numerical values of the object coordinates. OpenGL is not a mathematic library http://www.opengl.org/discussion_boards/ubb/wink.gif, sorry.

Rajveer
04-10-2002, 10:41 AM
I see....
Well do you know of any existing libraries that would do something like this? Or do you know where I could get information for such a library?

mproso
04-10-2002, 12:09 PM
I think something like this is posible using GL_FEEDBACK rendering mode and
glFeedbackBuffer function.
I'm not 100% sure,I never used those, but maybe that is what you are looking for.
Good luck experimenting!

Rob The Bloke
04-10-2002, 12:55 PM
Originally posted by mproso:
I think something like this is posible using GL_FEEDBACK rendering mode and
glFeedbackBuffer function.
I'm not 100% sure,I never used those, but maybe that is what you are looking for.
Good luck experimenting!

OpenGL is not designed to be something that returns values you've already input. You could grab the modelview matrix if you really wanted (glGet* funcs), but there is a performance hit involved in doing so. Feedback stuff is not really ideal for this IMO. in the long run it's better to store and retrieve the values yourself (which you have to do anyway...), usually in some form of hierarchical tree.

You may well be able to find a shareware or freeware scenegraph API if you really do need to do that, but ultimately you've hit the realm of software engineering.

Furrage
04-11-2002, 05:06 AM
As stated above OpenGL isn't ideal for that. It's better you do the maths yourself and code it.