View Full Version : HL BSP texcoords
03-05-2003, 01:58 AM
Well i've noticed that some of you have done Half-Life BSP loading so can someone please tell me how to calculate them.The deal is this:
each tex_info has this little thingy:
and i should use this to calculate the texture coords for the current vertex.Can anybody tell me how exactly to do this???
10x a lot!
03-05-2003, 03:49 AM
vecs and vecs are two vectors defining a base + 2 offsets. Just take the dot product of the vertex position and each vecs, adding the proper offset, to get the texture coordinates:
u = x*vecs + y*vecs + z*vecs + vecs;
v = x*vecs + y*vecs + z*vecs + vecs;
03-05-2003, 09:52 PM
Hey,10x!!!I also found a that i must divide the texcoords by the the width and height of the used image.
03-05-2003, 10:34 PM
Of course, as OpenGL tex coords are in the range [0;1], whereas quake/halflife coords are in the range [0;texsize]
03-06-2003, 10:57 PM
Ok!You seem to know a lot about the BSP stuff.Can you tell me your mail so we can discuss a lot of things without pissing the moderators because of the multiply HL BSP posts!
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.