Development > Newbie Coding
extracting surface parameters from .map files
ShipIt:
In order to bring the material files up-to-date, I have some script to find out what textures are used in the maps. But of course some textures are rarely used and not worth an entry in the material file, while others are very important. So I want to compute on how many 'square units' each texture is used.
In the map files a brush is defined like that:
--- Quote ---// brush 0
{
( 128 192 4 ) ( 128 0 4 ) ( 0 192 4 ) tex_nature/desert001 0 0 0 0.25 0.25 65280 0 0
( 128 192 128 ) ( 0 192 128 ) ( 128 192 0 ) tex_nature/flower 0 0 0 0.25 0.25 65280 0 0
( 128 192 128 ) ( 128 192 0 ) ( 128 0 128 ) tex_nature/dirt_se01 0 0 0 0.25 0.25 65280 0 0
( 0 0 0 ) ( 128 0 0 ) ( 0 192 0 ) tex_common/nodraw 0 0 0 0.25 0.25 65280 0 0
( 0 0 0 ) ( 0 0 128 ) ( 128 0 0 ) tex_nature/dirt002 0 0 0 0.25 0.25 65280 0 0
( 0 0 0 ) ( 0 192 0 ) ( 0 0 128 ) tex_nature/desert009 0 0 0 0.25 0.25 65280 0 0
}
--- End quote ---
I have no problems to extract the coords, texture IDs and the properties from that. But I am lost on computing the info I want from the given vertices. Why there are only three coordinates, even if the face has four or even more? Maybe someone can explain this to me?
Sandro:
Those are not vertices; those are clipping planes for convex polytopes called brushes.
ShipIt:
So computing the surface area for each plane from those numbers is not possible ? Or just very hard to do?
Sandro:
Possible, but will requre some serious math. Or you can use the processed data from .bsp files.
ShipIt:
Unfortunately I am unable to do serious math nor do I know how to access the data in the bsp files. So any hint would be welcome.
Navigation
[0] Message Index
[#] Next page
Go to full version