Jump to content
  • Advertisement
Sign in to follow this  
havythoai

How to create the bounding box ?

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

Dear everybody, First, I thank everybody for Frenet frame topics that help me create successfully the swept surface. Second,I'm doing the NC machining simulator, now the next work is that I have to take the swept surface to intersect stock (representing by Z vectors). My swept surface is series of triangles, and I have known the algorithm of Ray - Triangle intersection. The problem I got is that how to create a bounding box around a given triangle so that Z vectors which in bounding box would be taken to intersect with that triangle, but it don't take the Z vectors outside the bounding box to do. here is the picture http://upload.tinhco.net/thoai/boundingbox.JPG I never do this before, so the term "bounding box" is new to me. Is there any idea ? or a similiar example code would be nice \:D please, help me \:\)

Share this post


Link to post
Share on other sites
Advertisement
If you want an axis-aligned bounding box the easiest way is to get the minimum and maximum vectors from the triangle's vertices.

Example:

min.x = min(v1.x, v2.x, v3.x);
....

If you need the bounding box to be aligned with the axes of the stacks coordinate system, you could transform the triangle into this coordinate system if it doesn't correspond to the world's coordinate system.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!