Quake .map brush formats! HELP

Blitz3D Forums/Blitz3D Programming/Quake .map brush formats! HELP

Neochrome(Posted 2004) [#1]
{
"classname" "func_train"
// brush 0
{
( 72 -16 -112 ) ( -40 -16 -112 ) ( -40 -88 -112 ) common/lightgrid 0 0 0 0.500000 0.500000 0 13 0
( -40 -88 -56 ) ( -40 -16 -56 ) ( 72 -16 -56 ) common/lightgrid 0 0 0 0.500000 0.500000 0 13 0
( -40 -88 -56 ) ( 72 -88 -56 ) ( 72 -88 -112 ) common/lightgrid 0 -16 0 0.500000 0.500000 0 13 0
( 72 -88 -56 ) ( 72 -16 -56 ) ( 72 -16 -112 ) common/lightgrid 0 -16 0 0.500000 0.500000 0 13 0
( 72 -16 -56 ) ( -40 -16 -56 ) ( -40 -16 -112 ) common/lightgrid 0 -16 0 0.500000 0.500000 0 13 0
( -40 -16 -56 ) ( -40 -88 -56 ) ( -40 -88 -112 ) common/lightgrid 0 -16 0 0.500000 0.500000 0 13 0
}
}

i dont under stand the math to this. Can anyone convert it to 6 vertex points?

and tell me how?


JaviCervera(Posted 2004) [#2]
It does not contains vertices. It contains 6 planes, each one defined by 3 points. I think there are tutorials out there to convert each 3 point plane into a plane defined by 3 normal components and a distance. Then you check for intersections between the planes of the brush. When 3 or more planes collide, a vertex must be added.

Then you need some CSG functions that determines when a new vertex must be deleted (its mainly a matter of checking if the vertex is on the back of any of the planes, and in that case delete it).

And once you have the vertices for your polygon, you must make a function to sort them in clockwise order.

So you have some work to do. If you don't understand normals nd vectors very well, it would be complicated.


CyberHeater(Posted 2004) [#3]
Neomancer. Good luck. I had a look at this over a year ago. Strangly enough, there isn't a lot of source code on the web which shows you how to do this.

Jedive's description was pretty good.

Please post the code if you manage to crack it. It would open up a lot of possibilities for Blitz.


MattG(Posted 2004) [#4]
check out some of the mapfiles links on this page :

http://members.fortunecity.com/torktools/doc.html

Matt


Warren(Posted 2004) [#5]
Strangly enough, there isn't a lot of source code on the web which shows you how to do this.

Id Software has released the source code for Quake1 and Quake2, as well as for all of the BSP compiling tools.

I'd say there's a hell of a lot of source out there. :)


CyberHeater(Posted 2004) [#6]
Epicboy. There isn't a lot of source code how to convert map format data to vertex data. I've done a lot of searching for it in the past. Looking forward to you proving me wrong.


Warren(Posted 2004) [#7]
Again, the source for Quake1/2 and the BSP tools are available for download. The BSP tools read map files and convert them into sets of vertices and polygons, complete with texture mapping coordinates.

What more are you looking for?