Thread: Please help me with interseciton of planes

  1. #1
    Shadow12345
    Guest

    Please help me with interseciton of planes

    Does anyone here know how to find the intersection of two planes? I am trying to read a file and the coordinates are derived from the intersection of two triangles that represent a plane.

    i.e
    (234 432 234) (234 523 275) ( 245 643 236)
    (512 768 1024) (123 432 234) (234 456 675)
    That is what the format looks like, obviously each line represents a triangle, which represents a plane, and the actual coordinates are derived from where those planes intersect. I have not taken any math that has even touched on this that is why I am asking for someone that may already know how to do this.

  2. #2
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    i know how to solve it using inverse matrices...but the answer is in matrix form...and i don't know how to do matrice calculations for you program (prob use for loops)...try googling is about all i can say...if you want the inverse matrix way just let me know
    PHP and XML
    Let's talk about SAX

  3. #3
    Shadow12345
    Guest
    yes I would love the answer using inverse matricies, that is something I can understand. If you want to skip the ascii art and mail a picture or something you can send it to:
    [email protected]
    or you can just post it here i don't care either way

    forego explaining exactly what it means, ill figure it out for myself when i have it in front of me, if I have specific questions I'll ask later.

    EDIT:
    I somewhat understand the equations that are used to represent a plane (I was looking at a shadow casting matrix in one of my books) just to give you an idea of what I already know about this topic (which all in all insn't much)

  4. #4
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    ok lets see, you have x y and z...so i can post some example math equations that you can port over to code.
    [algebra]

    x+2y-z=10 //note: equations probably don't work out, just an example
    2x+4y+z=-1

    //you take the coeffecients of the variables into matrix a
    1 2 -1
    2 4 1
    //then take the sums
    10
    -1
    //find the inverse of the first matrix and mulitply it by the second matrix, the resulting matrix will be a set of points for x y an z

    [/algebra]
    PHP and XML
    Let's talk about SAX

  5. #5
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Umm, Waldo what do you mean?

    You cannot find the inverse of a non-square matrix!

    The intersection of two planes is a line.

    *With the three points, you can create two vectors in the plane.
    *Use these two vectors to find the normal vector (A,B,C)
    *With the normal vector and one of the points, create the equation Ax + By + Cz + D = 0 both both planes.
    *Solve the equation system

    If there's a result, it should be of the form:

    {x = x0 + at
    {y = y0 + bt
    {z = z0 + ct
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  6. #6
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Aha, your version works if you add z=t to your matrices.

    Plane 1 : x + 2y - z = 10
    Plane 2 : 2x + 7y + z = 1

    Code:
        ( 1 2 -1 )
    A = ( 2 7 1  )
        ( 0 0 1  )
    
        ( 10 )
    B = ( 1  )
        ( t  )
    
    ( x )
    ( y )  =  A^-1 * B
    ( z )
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  7. #7
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    >>aha...

    i knew it had to work...if not then where the heck has my calculator been getting answers from?? lol

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. malloc issues
    By baffa in forum C Programming
    Replies: 9
    Last Post: 11-11-2007, 01:47 PM
  2. need help quick
    By theOracle in forum C++ Programming
    Replies: 3
    Last Post: 04-20-2005, 03:08 PM
  3. gluPerspective culling planes
    By linuxdude in forum Game Programming
    Replies: 5
    Last Post: 07-31-2004, 03:36 PM
  4. Undefined Error
    By peking1983 in forum C++ Programming
    Replies: 1
    Last Post: 03-11-2003, 03:55 PM
  5. Geometric Libraries and Coordinate planes
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 11-11-2001, 02:46 PM