OT - quake .map to triangle code

Hi

I need to get a list of triangles from a quake .map file. Does anyone know a url which points to working code?

Many thanks

let me see if I can remember how this works. A map file contains a whole load of 3 point planes ( 9 values per plane) and you can work out the exact points / triangles of each ‘brush’ by performing some kinda heavy planar intersection code.

e.g. if you have a cube, it will be defined as 6 planes (totalling 18 points) in the .map file. Find the intersections of 3 planes at a time and you can work out the 6 points in 3d space that make up the brush.

Obviously it’s slighly different for a wedge brush (5 planes)

The reason all the planar stuff is used is because BSP uses planes.

So, you can parse the .map file yourself and apply various planar intersection calculations to figure out all the triangles you need to draw.

Google several Mathematics sites, and good luck!

I checked a lot of tuts about Quake BSP, and the problem is that the BSP can be optimized by yourself, so we can’t load any BSP, i don’t know for the .map :rolleyes: