Triangulating a plane

This is a discussion on Triangulating a plane within the Game Programming forums, part of the General Programming Boards category; Was looking at the CSX format used by Torque Constructor, to see if I might be able to write a ...

  1. #1
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070

    Triangulating a plane

    Was looking at the CSX format used by Torque Constructor, to see if I might be able to write a loader for it. Luckily it's XML, so no probs there.

    But one thing that's throwing me off, is the way faces are defined in the file:
    <Face id="36" plane="1 -0 0 -2" material="uvchart128" texgens="-0 0.25 0 0.5 0 0 -0.25 -0.5" texScale="1 1" texDiv="128 128" />
    How does one go about making triangles out of a plane as defined here?
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    I'm sort of confused as to what you mean since any 3 points in space, thus any triangle, form a plane.

  3. #3
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    Are there vertices elsewhere in the file that link to that face id? Seems kinda silly that they'd have a separate vertex and face tag, but who knows.

  4. #4
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,070
    Quote Originally Posted by jverkoey
    Are there vertices elsewhere in the file that link to that face id?
    Nope, that's the problem.

    Usually in a file containing geometry info, I get lists of faces, vertices, and indices. In this file, all I get is face info with that plane definition.

    Quote Originally Posted by Bubba
    I'm sort of confused as to what you mean since any 3 points in space, thus any triangle, form a plane.
    What I mean is, basically, that I have no idea what the values given for the plane mean/do, and how I would take that information, and create a triangle out of it.

    EDIT: ugh, well now I'm confused. I just tried a different CSX, and I get the vertex info and stuff. I thought it might have been because the first one I tried was just some boxes, but I tried saving another with just a cube, and I get vertices for that too. Weird.

    I'm still curious about what to do if I just have a plane, though .
    Last edited by psychopath; 07-12-2007 at 10:01 AM.
    Memorial University of Newfoundland
    Computer Science

    Mac and OpenGL evangelist.

  5. #5
    Registered User
    Join Date
    Apr 2006
    Posts
    41
    A guess is that the plane might be defined as the normal + a scalar D.

    For all the points (P) on the plane, something like the following is true: D = -dot(P, normal).

    Not easy to do anything else if you should represent an infinite plane.

  6. #6
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    The only thing I can think of is perhaps they are representing a plane by:

    ax+by+cz+dw=0

    That would explain the four numbers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Insane far plane
    By VirtualAce in forum Game Programming
    Replies: 0
    Last Post: 09-24-2008, 11:36 PM
  2. create plane in 3D and
    By michi7 in forum Tech Board
    Replies: 6
    Last Post: 07-22-2008, 03:31 PM
  3. Textured plane suggestions
    By VirtualAce in forum Game Programming
    Replies: 9
    Last Post: 04-20-2004, 09:28 PM
  4. Clipping plane prob?
    By gazsux in forum Game Programming
    Replies: 7
    Last Post: 07-04-2003, 09:49 PM
  5. the plane passing the moon
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-20-2003, 08:11 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21