Jump to content
  • Advertisement
Sign in to follow this  
Dirk Gregorius

Calculation of texture coordinate in Q3 .map files

This topic is 5455 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

Hi, I am currently loading a Q3 .map file. While loading the geometry data works fine now, I have problems calculating the texture coordinates for a brush. A Brush line in the file looks like this: ( 64 0 0 ) ( 0 0 0 ) ( 0 0 64 ) BCRATE02 1 0 0 0 0 0 -1 0 The last eight values define the texture space. What I do at the moment is the following: 1. Load each four values into a plane 2. Calculate s, t seperately: s = ( vertex * plane1.normal + plane1.d ) / Texture_Width; Unfortunaltely the values become very big. Is this method correct and if yes how can I transform the coordinates into the range [ 0, 1 ]? Any help is greatly appreciated. -Dirk PS: Does anybody know how to parse the patch definitions?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • 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!