Jump to content
  • Advertisement
Sign in to follow this  
Ivan Mandic

Box rotation

This topic is 3301 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. If I have a box ABCDEFGH[A(X,Y,Z),B(X,Y,Z)...H(X,Y,Z)] and I roteate it around XYZ axis,how can I calculate new coordinates of points ABCDEFGH? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Transforming the box corners is really just like transforming any geometry (such as a mesh model). The most common way to do this is to construct a matrix representing the desired transform, and then apply it to each vertex (the box corners, in this case) in turn.

May I ask what you need the transformed corners for? (I ask because if it's for collision detection or frustum culling, you most likely don't actually need the transformed corners.)

Share this post


Link to post
Share on other sites
Quote:
Thanks for your reply. I want to add BoxInFrustum to NeHe's frustum culling: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=44
You don't need to compute the transformed vertices of the box in order to perform frustum culling; for boxes (both oriented and axis-aligned), you can perform the box-plane test more directly by comparing the projected radius of the box to the distance from the box center to the plane.

More info here and here.

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!