Sign in to follow this  
structi

OpenGL how to get new cordinates when rotate an object

Recommended Posts

Hello everyone I have object coordinates in a file and I am rendering it from this file. But I wonder whether Opengl give to provide new coordinate to me. Because I want to know collision beetween this object and another object. But object may rotate and I have only ex coordinates.

Share this post


Link to post
Share on other sites
I rotate using rotatef function and then whole coordinates change. But I want to get new coordinates. Does openGL provide this?

Share this post


Link to post
Share on other sites
Not as such. Note that it has worst case performance for complex 3d objects to test vertex by vertex. For collision detection you should work with bounding volumes.

Anyway, you have to manually transform your collision set (the original vertices or the bounding volume). Dave told you how to do this. And you have to do it yourself.

Share this post


Link to post
Share on other sites
Quote:
is there any sample project about this?
What do you mean?

As mentioned, you'll almost certainly want to use simplified geometry for collision rather than the exact mesh geometry. If you do want to use the mesh geometry though, you'll need to manuallly transform each vertex in the geometry by the object transform.

Can you be more specific about what part you need help with?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this