# How to create the bounding box ?

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

## 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 on other sites
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.

1. 1
2. 2
3. 3
Rutin
18
4. 4
5. 5
JoeJ
13

• 14
• 10
• 24
• 9
• 57
• ### Forum Statistics

• Total Topics
632640
• Total Posts
3007616
• ### Who's Online (See full list)

There are no registered users currently online

×