Can anyone explain what the math is behind if you want the texture to be perfect scale 
on the face on a brush, the axes need to define a plane that is parallel to the face's 
plane, otherwise you'll get stretching.

As I have read on the VERC it states:
These axes are defined by tx1/y1/z1 and tx2/y2/z2, giving two vectors which define what's "right" and what's 
"up" relative to the texture - so if you wanted to go "right" 1 unit, you'd go along the first axis for 1 
unit. Going "down" 2 units would be going backwards along the second axis for 2 units. How much the texture is 
offset along these axes is defined by toffs1 and toffs2, measured in HL units.

I am trying to work up a way to export a polygonal soup into MAP brushes for a simple 
editor I am working to understand the MAP format better. I have searched the web for 
days, and havent come close to any sensible solution to figuring out how these axis 
number come to be. I know that it has to do with Normals and can sort of figure out 
one set but not the 2nd set needed.

Thanks

You must multiply the vector for the s & t texture coordinates (right & up) with the vertex of your polygon, that's all. (Well, and add the offset of course :)

If you have a texture with offsets both 7 and s = (1,0,0), t = (0,0,-1) and a vertex 
at (20,200,96) you calculate for s:
20 * 1 + 200 * 0 + 96 * 0 + 7 = 27
and for t:
20 * 0 + 200 * 0 + 96 * (-1) + 7 = -89

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders



Reply via email to