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
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 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:
better normalize the normal now...
all what is still left is d;
which can be calculated:
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
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!