   Quake 3 .map
  What do the values in a .map (Quake 3 level format) file mean?Example:// entity 0{"classname" "worldspawn"// brush 0{( -6 1 8 ) ( -6 0 8 ) ( -7 1 8 ) NULL 0 0 0 0.25 0.25 0 0 0( 1 8 2 ) ( 0 8 2 ) ( 1 8 0 ) NULL 0 0 0 0.25 0.25 0 0 0( 8 8 2 ) ( 8 8 0 ) ( 8 7 2 ) NULL 0 0 0 0.25 0.25 0 0 0( -7 0 0 ) ( -6 0 0 ) ( -7 1 0 ) NULL 0 0 0 0.25 0.25 0 0 0( -7 0 0 ) ( -7 0 2 ) ( -6 0 0 ) NULL 0 0 0 0.25 0.25 0 0 0( 0 1 0 ) ( 0 2 0 ) ( 0 1 2 ) NULL 0 0 0 0.25 0.25 0 0 0}}I understand the 'brush 0' to be the first brush, but the series of coordinates are somewhat strange.  This code is for an 8*8*8 brush with no textures.  I originally guessed that each line was for a triangle in the shape, but a cube has 6 sides * 2 triangles per square for 12 triangles... no good.  I saw something somewhere that said that each line was a plane, but I don't understand how that would work with the given coordinates.The end goal for me is to be able to take a .map file and render the contents with OpenGL.  I believe there is functionality for displaying planes (as well as most any other shape), but right now I'm stuck with parsing!  Any help is greatly appreciated :)   
Quote:Original post by Fiarr I originally guessed that each line was for a triangle in the shape, but a cube has 6 sides * 2 triangles per square for 12 triangles... no good.  I saw something somewhere that said that each line was a plane, but I don't understand how that would work with the given coordinates.The triangle you see on each line defines a triangle that lies on a plane; those planes then create a solid, whose verticies are the intersections of said planes, and whose faces are sections of respective planes.  Try graphing the planes of this cylinder:{( 0 -384 0 ) ( 256 -512 0 ) ( 512 -384 0 )( 512 -128 256 ) ( 512 -384 256 ) ( 256 -512 256 )( 512 -128 0 ) ( 512 -128 256 ) ( 256 0 256 )( 512 -384 0 ) ( 512 -384 256 ) ( 512 -128 256 )( 256 -512 0 ) ( 256 -512 256 ) ( 512 -384 256 )( 0 -384 0 ) ( 0 -384 256 ) ( 256 -512 256 )( 0 -128 0 ) ( 0 -128 256 ) ( 0 -384 256 )( 256 0 0 ) ( 256 0 256 ) ( 0 -128 256 )}[Edited by - _fastcall on June 15, 2009 9:20:16 PM];  Ah, I see how the file works.  Now my problem is determining whether or not any given three planes intersect, and then finding the point of intersection.  I've found an equaiton for finding the point of intersection, but the math is a bit beyond me: http://softsurfer.com/Archive/algorithm_0104/algorithm_0104B.htmDoes anyone know of a formula that isn't in "Parametric equation representation?"   