rotating and keeping coordinates

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?

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 , sorry.

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?

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!

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.

As stated above OpenGL isn’t ideal for that. It’s better you do the maths yourself and code it.