This is a repost of a question that went unanswered
basically I am trying to model a map that has the following format:
Each brush defines a solid region. Brushes define this region as the intersection of four or more planes. Each plane is defined by three noncolinear points. These points must go in a clockwise orientation:
1--2-----------------> | 3 | | | | | ,
Each brush statement looks like this:
{ ( 128 0 0 ) ( 128 1 0 ) ( 128 0 1 ) //plane 1 ( 256 0 0 ) ( 256 0 1 ) ( 256 1 0 ) //plane 2 ( 0 128 0 ) ( 0 128 1 ) ( 1 128 0 ) //plane 3 ( 0 384 0 ) ( 1 384 0 ) ( 0 384 1 ) //plane 4 ( 0 0 64 ) ( 1 0 64 ) ( 0 1 64 ) //plane 5 ( 0 0 128 ) ( 0 1 128 ) ( 1 0 128 )//plane 6 }
That's probably just a bit confusing when you first see it. It defines a rectangular region that extends from (128,128,64) to (256,384,128). Here's what a single line means:
( 128 0 0 ) ( 128 1 0 ) ( 128 0 1 ) 1st Point 2nd Point 3rd Point
I need to find the intersection points of the planes so I can draw the shape only using a method that can draw 2d panels in 3d space. The following code would draw a triangle in space for example:
beginShape(); vertex(x0,y0,z0); vertex(x1,y1,z1); vertex(x2,y2,z2); vertex(x0,y0,z0); endShape();
Is there a better way to calculate the vertices than to loop through all possibilities of plane interesctions?