Yay

Quake3 brush format = way fun as the numbers don't seem to make any sense at first glance. These numbers do not represent vertices, or angles. Instead, they define 3 'virtual' points per face. These 3 points uniquely define a plane in 3d space. The plane extends to infinity, so the extents of each face are not contained in the definition of each face.
When mohradiant or q3map reads the brush data, it simply calculates the intersections between two planes. The result is an infinitely long line. The only case when 2 infinite planes don't intersect is when they are parallel.
Having determined these infinitely long lines (there will be 12 for a regular (box) brush), the intersections of these lines are determined. Two lines intersect if they are not parallel and lie in a single plane. The intersections of these lines give the brush vertices, and the finite line between them becomes and edge. Voil?, a brush
Note that the virtual points that define each plane are rather arbitrary: if you translate them within the plane they define, they still define the same plane. Huh

. Well, say we're talking about the top plane, and it were defined as:
( 48 -16 64 ) ( 48 16 64 ) ( 88 16 64 ) common/woodclip 0 0 0.00 1 1 536870912 16544 0 surfaceColor -1.000000 -1.000000 -1.000000
You can easily see it is a horizontal plane, as all z-coordinates are equal. This means that you can add any 2 numbers to the x and y coordinates and still get the same plane (and thus the same brush). Note that you have to add the same two numbers to each vectors, otherwise the shape of the virtual triangle changes. Example:
( 0 0 64 ) ( 0 32 64 ) ( 40 32 64 ) common/woodclip 0 0 0.00 1 1 536870912 16544 0 surfaceColor -1.000000 -1.000000 -1.000000
And you still have the same brush
Things to watch out for:
- If the three virtual points lie on one line, a plane cannot be defined. This is called a degenerate plane.
- If you swap the order of the points, you also swap the direction of the plane. This means the face which was initially facing out, is now facing in. q3map will report this as a bad normal.
So what is the right order to use? This is determined by the right-hand rule, which is somewhat cumbersome to explain in text. Fortunately, wikipedia has a nice article on it
http://en.wikipedia.org/wiki/Right_hand_rule
The 'x' and 'y' axes are determined by taking the difference between point [2 and 1] and [3 and 1] respectively. So that:
x = point2 - point1
y = point3 - point1
If you are familiar with vector mathematics:
normal = -
x x
y
Where 'x' denotes the
vector cross product.
The '-' appears because, for some reason, radiant uses a left hand rule rather than a right hand rule. This is identical to swapping x and y axes, so that:
normal = -
x x
y =
y x
x
Applying this to the top face above:
x = ( 0 32 64 ) - ( 0 0 64 ) = (0 32 0)
y = ( 40 32 64 ) - ( 0 0 64 ) = (40 32 0)
normal =
y x
x = (40 32 0) x (0 32 0) = (0 0 1280) [
calculator]
What we have now is a vector pointing straight up, which means the face under consideration (the top plane), is actually a top plane
Hope this helps a bit, if not I'll try again
Good luck.
