Jump to content
  • Advertisement
Sign in to follow this  
Libinson David

Bounding Box Rotation and glRotatef problem.

This topic is 4480 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

I have Bounding Box class which has: Vector3D m_min; Vector3D m_max; Vector3D m_position; The position is: m_position=m_max-m_min; I need to rotate the object. After applying glRotatef function the min and max vectors are changes but, In the real life the values are the same. How to calculate the new min and max position? May be it’s better to calculate this without glRotatef in order to control the object? Please help.

Share this post


Link to post
Share on other sites
Advertisement
You should use glRotate, glTranslate, glScale, and glMultMatrix only for actual rendering purposes. Its better to implement a class for homogeneous matrices to track transformations yourself. Apply the belonging transformations to such a matrix, and apply the matrix to the bbox, then use the result for collision purposes.


BTW: Shouldn't m_position be (m_max+m_min)*0.5? Because m_max-m_min defines the extent of the box, and not its position...

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!