I'm trying to render the brushes from a Source engine .vmf file in C++, using OpenGL. My immediate goal is to make a simple vmf editor.
The .vmf stores solid brushes as a series of planes which I would like to use to calculate the points for each brush. I'm pretty sure this would be done exactly the same as for all Quake engine based .map files as well.
Basically each point of the brush is the point where 3 planes intersect. I found a similar question to mine on stackoverflow and the explanation is to get the unit normals for the 3 planes, then use equation 8 on this page http://mathworld.wolfram.com/Plane-Plan ... ction.html. My problem is that I have no idea how to implement that, or even if that's the best way.
Here's some code for a single 6 sided cube shaped brush:
"plane" "(0 0 256) (0 256 256) (256 256 256)"
"plane" "(0 256 0) (0 0 0) (256 0 0)"
"plane" "(0 0 0) (0 256 0) (0 256 256)"
"plane" "(256 256 0) (256 0 0) (256 0 256)"
"plane" "(0 256 0) (256 256 0) (256 256 256)"
"plane" "(256 0 0) (0 0 0) (0 0 256)"
I really have no idea where to start, any help would be appreciated, thanks.