Quake 3 .map brush standards


(bradsmithee) #1

In a very vain effort for the past few days I have been attempting to pick up and
decipher the fundamental design of a simple brush so that I may create a .ase
to .map converter. This would allow a modeled map to be converted triangle by triangle
into brush works.

By glancing at the .map file, I had assumed that the standards for a brush were part of a simple face design :
(Vert1X, Vert1Y, Vert1Z)(Vert2X, Vert2Y, Vert2Z)(Vert3X, Vert3Y, Vert3Z) = 3 verts, 1 face.

This was abruptly dismissed after radiant loaded a horrible skewn setup on my early
conversions. Back to the drawing boards I studied and tested with multiple values a
single 4 sided and 3 sided (preferenced) hoping I could unwrap the mystery within.
After this failed on dozens of failed pattern predictions, I decided to come here by suggestion.

I’m no math genius and it has become quite obvious now that Q3 brushes don’t follow
simple vert rules. From what I can grasp, they MUST follow some sort of matrices
design that of which I do not comprehend.

If someone could kindly explain to me a SIMPLE means to convert a single triangle
(3 vertices with XYZ info) into a single simple workable Q3 brush, I’d be VERY VERY VERY grateful.

Thanks in advance for anyone who responds even :slight_smile:


(SCDS_reyalP) #2

You can download the radiant and q3map sources from zerowing.idsoftware.com

Brushes are defined by planes. This describes it very briefly http://www.quake3world.com/ubb/Archives/Archive-000004/HTML/20020703-6-019324.html
I’m sure there is a better description somewhere, but I don’t have it offhand.


(Chruker) #3

The 3 verts you have describes a plane in radiant.

Now brushes must always have a volume. So you need at least 4 planes for a brush.

If you wanted to make a cube. You would need 6 planes cause it has 6 sides.

Here is some code from a php script I made, which takes a heightmap and creates a terrain prefab.


function terrain_rectangular ($i, $x_coord, $y_coord, $z_coord, $x_size, $y_size) {
	global	$map_min_z_height;
	$va = ($x_coord).", ".($y_coord - $y_size).", ".($z_coord);
	$vb = ($x_coord + $x_size).", ".($y_coord - $y_size).", ".($z_coord);
	$vc = ($x_coord + $x_size).", ".($y_coord).", ".($z_coord);
	$vd = ($x_coord).", ".($y_coord).", ".($z_coord);
	$vo = ($x_coord).", ".($y_coord - $y_size).", ".($map_min_z_height);
	$vp = ($x_coord + $x_size).", ".($y_coord - $y_size).", ".($map_min_z_height);
	$vq = ($x_coord + $x_size).", ".($y_coord).", ".($map_min_z_height);
	$vr = ($x_coord).", ".($y_coord).", ".($map_min_z_height);

	$brush = "	// Brush ".($i + 1)."
";
	$brush .= "	{
";
	$brush .= "		( ".$va." ) ( ".$vd." ) ( ".$vb." ) common/terrain 0 0 0 0.5 0.5 134217728 0 0
";	// Top
	$brush .= "		( ".$vo." ) ( ".$vp." ) ( ".$vr." ) common/caulk 0 0 0 0.5 0.5 134217728 0 0
";		// Bottom
	$brush .= "		( ".$va." ) ( ".$vb." ) ( ".$vo." ) common/caulk 0 0 0 0.5 0.5 134217728 0 0
";		// South side
	$brush .= "		( ".$vb." ) ( ".$vc." ) ( ".$vp." ) common/caulk 0 0 0 0.5 0.5 134217728 0 0
";		// Easy side
	$brush .= "		( ".$vc." ) ( ".$vd." ) ( ".$vq." ) common/caulk 0 0 0 0.5 0.5 134217728 0 0
";		// North side
	$brush .= "		( ".$vd." ) ( ".$va." ) ( ".$vr." ) common/caulk 0 0 0 0.5 0.5 134217728 0 0
";		// West side
	$brush .= "	}
";
	
	return $brush;
	}

Hope this clarification helps.