Woldcraft .map files. seriously NEED help!

Started by
4 comments, last by Zerosignull 22 years, 1 month ago
OK need help on this. // ----- start ----- { "classname" "worldspawn" "wad" "\half-life\valve\halflife.wad;\half-life\valve\decals.wad" { ( 0 0 64 ) ( 128 0 64 ) ( 128 -128 64 ) CRETE3_WALL01 0 0 0 1.000000 1.000000 ( 0 -128 0 ) ( 128 -128 0 ) ( 128 0 0 ) CRETE3_WALL01 0 0 0 1.000000 1.000000 ( 0 0 64 ) ( 0 -128 64 ) ( 0 -128 0 ) CRETE3_WALL01 0 0 0 1.000000 1.000000 ( 128 0 0 ) ( 128 -128 0 ) ( 128 -128 64 ) CRETE3_WALL01 0 0 0 1.000000 1.000000 ( 128 0 64 ) ( 0 0 64 ) ( 0 0 0 ) CRETE3_WALL01 0 0 0 1.000000 1.000000 ( 128 -128 0 ) ( 0 -128 0 ) ( 0 -128 64 ) CRETE3_WALL01 0 0 0 1.000000 1.000000 } } { "classname" "info_player_start" "origin" "256 -128 0" } // ----- end ----- ok from the (or ne other .map file) obove how do i get vertex information from it? valve say that each of the peaces of information in ( ) are ( x,y,z) co-ordinates for a plane(or brush. what is a brush??). Now if i get my program to treat these values as ''actuall'' vertex information for a triangle the results are some what f''ed up. What am i supposed to treat the information as to render the informatio in the file to display it the way it supposed to be???! ps i know what the information is after the 3 sets of bracked information is, TEX name blar blar blar .. ~prevail by daring to fail~
Advertisement
Valve is correct in saying that each of the three points define a plane. The "brush" (a visible textured geometry object) is defined as the intersection of 4 or more planes. Each plane is textured blah, blah, blah...

For all those that tried, and haven''''t gone and died. I salute you.
For all those that tried, and haven't gone and died. I salute you.
so how do i go aobut generating verteces of triangles then from these files?

~prevail by daring to fail~
Well... i''ve seen this question asked many many times... so here''s the answer (sort of ) Ok, i''m not sure how much math or 3d backround you have but i''ll give you the basics. Each chunk that you have defines a brush. A brush is a 3d chunk... the most comon and simple being a cube. A cube has 6 sides. Each line inside the {} represents ones of those sides. Do define a plane in 3d space you need 3 coordinates.. those are given inside the 3 sets of () on each line. After that you have the texture that is being used, and then 3 numbers representing vector info. Actually you should get a newer version of worldcraft, what you have there is out of date... the newest one puts data out like this...

{
( -3200 2624 192 ) ( -2752 2624 192 ) ( -2752 2560 192 ) BRICK [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -3200 2560 0 ) ( -2752 2560 0 ) ( -2752 2624 0 ) BRICK [ -1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -3200 2624 192 ) ( -3200 2560 192 ) ( -3200 2560 0 ) BRICK [ 0 -1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -2752 2624 0 ) ( -2752 2560 0 ) ( -2752 2560 192 ) BRICK [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -2752 2624 192 ) ( -3200 2624 192 ) ( -3200 2624 0 ) BRICK [ -1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -2752 2560 0 ) ( -3200 2560 0 ) ( -3200 2560 192 ) BRICK [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
}
notice how that set has [] [] Those two sets of numbers represent vectors used for textures and scaling (i don''t remember exactly how but i have a site bookmarked somewhere that explains it) so each line defines a plane, and those 6 planes intersect to form a cube. First step is to take that the planes and find out all the coordinates of the edges of the cube. Notice for the top of the cube there are 4 corners... but only 3 points given... you need to find the 4th. This can be done using linear algebra to find the intersection of 2 planes (you find the intersection of each plane that is not parallel to the one your trying to find the points for) Once you do that you have to find a neat way of listing those (so each point doesn''t come up 3 times) Then you have to use the dot product and more linear algebra to transfer the texture coordinates into what ever you need them to be. Ok, i wrote a program a little while ago that does all this... and basically takes the data i posted and puts it out in this format:

REDBRICK
98 0 80 98 -80
88 0 80 88 -80
88 0 70 88 -70
REDBRICK
98 0 80 98 -80
88 0 70 88 -70
98 0 70 98 -70
REDBRICK
98 -0.5 80 -98 -80
98 -0.5 70 -98 -70
88 -0.5 70 -88 -70
REDBRICK
98 -0.5 80 -98 -80
88 -0.5 70 -88 -70
88 -0.5 80 -88 -80
REDBRICK
98 0 80 -80 0
98 0 70 -70 0
98 -0.5 70 -70 0.5
REDBRICK
98 0 80 -80 0
98 -0.5 70 -70 0.5
98 -0.5 80 -80 0.5

where it states the texture used, then gives the 3 points of the polygon (triangle in this case) the 1st 3 numbers on each line are the x,y,z coordinates and the other 2 are texture coordinates. This is a similar format used in nehe''s 10th or 11th tutorail... i don''t remember which. But here... http://www.mines.edu/students/p/pfchrist/WCmapconvert.zip That is the VC++ 6.0 project with source. Now i have to say that this was done by me in 2 days... it won''t work on a random worldcraft .map, but if you make a simple one it probably will. You can look at the code and piece togeather most of what i did. I never ment to post this (at least not yet) so it is very very sloppy, i got it to work and was satisfied, nothing is commented unless i took that line out for troubleshooting, but its at least something to go by. Hope that helps... you can email me at drjonesdw3d@hotmail.com if you have any questions.

Dr. Jones
A comprehensive .map tutorial just became available here:

http://www.uio.no/~stefanha/Tutorials.html
Try this, thats my own program:
http://www.madensoft.com/LevelConverter.zip
It scans all data and convert them into triangles.
Additional items(like lights or selfmade stuff) will convert, too.

This topic is closed to new replies.

Advertisement