Results 1 to 2 of 2

Thread: Maths question: collision detection on ellipsoids

  1. #1
    Member Contributor
    Join Date
    Nov 2002
    Posts
    96

    Maths question: collision detection on ellipsoids

    I've posted this question on the Planetarion forums too ( http://pirate.planetarion.com/forum/...hreadid=154550 ) and I've gotten a formula that detects intersection of two ellipsoids:
    [(x1-x2)/(w1+w2)]^2 + [(y1-y2)/(h1+h2)]^2 + [(z1-z2)/(d1+d2)]^2 <= 1

    The slight problem is that the ellipsoids HAVE to be alligned to the axes for the formula to work, but I also want to detect collisions when the objects are rotated randomly in space.
    Does anyone happen to know how to accomplish this... how to alter the width/height/depth of the ellipsoid to be able to use the formula, or any other formula that'd work?

    TY

  2. #2

    Re: Maths question: collision detection on ellipsoids

    Given an ellipsoid equation of
    (x^2/a^2)+(y^2/b^2)+(z^2/c^2)=1
    you can parameterize any ellipsoid by x,y and z. Therefore if you are rotating or translating your ellipsoid you are changing the x,y and z parameters (ex. (x-1)^2 should translate x coord by +1). If you are changing the shape of it you are changing the a,b and c parameters (which are semi-axes).
    My guess is that you are simply translating your ellipsoids using TranslateF() and RotateF() and therefore the actual equations remain constant.

    You should change your code around so you affect the parameters of the equation rather than the vertices that are drawn.

    Then you will have to solve two quadratic equations (ellipsoid is a quadratic surface) in order to obtain an intersection.

    Hope this makes sense

    PS. Check this out: http://mathworld.wolfram.com/Ellipsoid.html

    [This message has been edited by EPHERE (edited 11-29-2002).]

Similar Threads

  1. [Question] collision detection between two car
    By rachmatarrmdhn in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 12-12-2014, 11:40 PM
  2. Collision Detection
    By I_NeedHelp in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 01-22-2003, 10:59 PM
  3. Wierd question about Collision Detection...
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 10-24-2000, 03:10 AM
  4. Maths stuff regarding Collision detection. (Polygons edge algorythm)
    By Anonymous Coward in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 10-13-2000, 02:15 PM
  5. collision detection contest: collision crazy
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-19-2000, 02:33 AM

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