how to get new cordinates when rotate an object
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.
If you transform an origin vector by the transform of the object you will get the position it has been transformed to.
I rotate using rotatef function and then whole coordinates change. But I want to get new coordinates. Does openGL provide this?
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.
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.
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement