Brush primitive parsing
We''re writing a custom map->bsp parser. The map format we uses the "new" GtkRadiant brush primitives (BrushDef), including brand spanking new texture positioning (kinda new, anyway).
We have no problem parsing any of the face details, except for the texture vectors. Does anyone have any pointers as to how to convert the 2 texture vectors into U/V coordinates for each face?
-M
Probably:
Pick one of the face vertices a reference point Pr.
Or you could choose any other point in the face plane as the reference.
For each vertex i, the u,v coordinates are:
Ui = ( Pi - Pr ) dot Tu
Vi = ( Pi - Pr ) dot Tv
Where Tu is one of the texture vectors and Tv the other. Ur and Vr are 0,0
Now I haven''t looked at the GtkRadiant format so you might need to translate or rotate the coordinates but the above should give at least a starting point.
Pick one of the face vertices a reference point Pr.
Or you could choose any other point in the face plane as the reference.
For each vertex i, the u,v coordinates are:
Ui = ( Pi - Pr ) dot Tu
Vi = ( Pi - Pr ) dot Tv
Where Tu is one of the texture vectors and Tv the other. Ur and Vr are 0,0
Now I haven''t looked at the GtkRadiant format so you might need to translate or rotate the coordinates but the above should give at least a starting point.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement