Quote:> turn into a real plane??? Isn't it a real plane??? How to do it???

Ok, maybe I expressed it wrong. Each three points define the plane they are

lying on.

All points that lie on a plane satisfy this equation:

x*nx+y*ny+z*nz = d;

where (x,y,z) is a point, (nx,ny,nz) the normal of the plane and d the

distance of the plane from the origin along the normal of the plane (in

units of ||n||).

So how to build a plane with three given points that lie on that plane?

let x1,x2,x3 be these three points.

v1=x2-x1;

v2=x3-x1;

v1 and v2 are two (non colinear) vectors that lie on the plane;

to finally get the normal, just do a crossproduct of v1 and v2:

n=v1^v2;

better normalize the normal now...

n=Normalize(n);

all what is still left is d;

which can be calculated:

d=x1.x*n.x+v1.y*n.y+v1.z*n.z;

Quote:> How can I make a polygon from it??? It musnt be a rectangle, it could also

> be an triangle or an polygon with x edges(or I'm wrong there???)

yes, it could be any (convex?) Polygon that is large enough. But rectangles

cover a large area and are easy to produce.

I really advice you to have a look into Quakes Tool sources!

Quote:> Why have I to split it with the other planes?

This is too hard for me to explain in English :-(

Just imagine a cube. You have created really big side-polygons. They have

already the right position but are so big that they do intersect each other.

Now imagine you cut away all parts that hang over the cube. What you did was

to split away all parts of each side-polygon that were lying in front of the

plane of each other side!

Here some pseudo-code:

for (int bs=0;bs<num_brushsides;bs++)

{

face=FaceForPlane(brushsides[bs].plane); // create the oversized

rectangle

for (bs2=0;bs2<num_brushsides;bs2++)

{

if (bs2==bs) continue;

SplitFrontPart(brushsides[bs2].plane,*face); // cut away

everything that lies in front of the other brushside, keeping the back-part

}

RenderFace(*face); // you should store your final face somewhere

}

I hope this helps a bit. And again, have a look into quakes tool sources!

Mathias