Results 1 to 2 of 2

Thread: Collision

  1. #1
    Guest

    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.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2002
    Location
    St. Louis, MO USA
    Posts
    177

    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.

Similar Threads

  1. Help with collision
    By BennyR in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-10-2014, 06:52 AM
  2. Collision
    By AleksX in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 10-10-2002, 12:47 PM
  3. Collision
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-20-2002, 06:54 AM
  4. collision detection contest: collision crazy
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-19-2000, 02:33 AM
  5. 2d collision
    By elmargo in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 07-22-2000, 04:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean