Jump to content
  • Advertisement
Sign in to follow this  
structi

OpenGL how to get new cordinates when rotate an object

This topic is 3174 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
If you transform an origin vector by the transform of the object you will get the position it has been transformed to.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!