Sign in to follow this  
ajm113

The ".map" Format, Where Is The Forth 3D Vector?

Recommended Posts

Hello all I've been looking through the .map files from game editors such as. "Hammer, Warcraft (Half Life's Editor), Doom3, etc". I'm thinking on making my own map compiler for my own binary map format so I have more flexability on using 3rd Party map editors or 3D applications to turn 3D files into my own map format my game engine can read and I find the .map very user friendly from Hammer Editor and easy as heck to parse, but one thing has made me scratch my head.

There appears to be only 3 3D vectors to specifiy a quad/face on a brush. I was able to draw most of the 3D vectors and such, but I couldn't draw the 4th vector on them, becuase I didn't know or couldn't predict where the forth vector would be.

Here is a Doom .map file.
[code]


Version 2
// entity 0

{

"classname" "worldspawn"

// primitive 0

{

brushDef3

{

( 0 0 -1 0 ) ( ( 0.125 0 -1 ) ( 0 0.125 1 ) ) "_emptyname" 0 0 0

( 0 0 1 -8 ) ( ( 0.125 0 -1 ) ( 0 0.125 -1 ) ) "_emptyname" 0 0 0

( 0 -1 0 0 ) ( ( 0.125 -0 -1 ) ( 0 0.125 0 ) ) "_emptyname" 0 0 0

( 1 0 0 -8 ) ( ( 0.125 0 -1 ) ( 0 0.125 0 ) ) "_emptyname" 0 0 0

( 0 1 0 -8 ) ( ( 0.125 0 1 ) ( 0 0.125 0 ) ) "_emptyname" 0 0 0

( -1 0 0 0 ) ( ( 0.125 -0 1 ) ( 0 0.125 0 ) ) "_emptyname" 0 0 0

}

}

}


[/code]

One thing I found interesting instead of using only 3D vectors they have a 4D vector as the first and 3rd. So I'm sorta confused on how to figure out the hole shape of a face on a quad/ of a "brush".



If anyone can explain why they use this method or can tell me how to figure out the "4th" vector for a quad from those variables, that would be appeciated,


thank you!

Share this post


Link to post
Share on other sites
[url="http://www.modwiki.net/wiki/MAP_(file_format)#Brush_definition"]From teh googlez.[/url]

Looks like they use a single normal vector to define the plane, with the fourth component of the normal vector the Euclidean distance to the origin. The remaining 3-component vectors describe the texture transform. The planes are described as infinite, thus the volume is described as the space bounded by the planes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this