-
Collision
I am loading and rendering models from .3ds files, i was wondering what is the easiest and quickest way to check if any of them are colliding.
-
Junior Member
Regular Contributor
Re: Collision
Use an axis-aligned bounding box. To calculate the box, loop through all of your vertices and find the maximum and minimum x,y,z values, and store them. Then the 8 corners of the box are like:
(min_x, min_y, min_z)
(max_x, min_y, min_z)
(max_x, max_y, min_z)
...etc.
To check if two axis aligned boxes collide, you see if any of the corners of one box are inside the other. This can be accomplished with a loop and simple < and > comparisons.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules