Original Post
I am making a .MAP files parser. What I''m trying to do is take a .MAP file (created by Valve Hammer Editor) and make a new text file that is just a list of all the triangles with texture coordinates. I have used this tutorial: http://folk.uio.no/stefanha/Downloads/MAPFiles.zip.
I am able to get all the vertices and even make triangle strips from them and sort them in clockwise order. The only thing I''m having trouble with is texture coordinates.
The .MAP file contains something called a texture axis, which basically says what percentage of the X, Y, and Z components are used in determining tu and tv. There is one texture axis for U and one for V. Doing a dot product with a vertex (there is actually a little more in the equation, but thats basically it) gives you the texture coordinate, but it is a huge number, and may be negative.
Once I have these huge texture coordinates, how can I get them into the range of 0 to 1 (for use with Direct3D)?
Proceeding on a brutal rampage is the obvious choice.