Advertisement Jump to content

Archived

This topic is now archived and is closed to further replies.

Grayling

Brush primitive parsing

This topic is 5834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!