Quake3 textcoords

Started by
12 comments, last by Enouk 22 years, 1 month ago
I kinda got curved surfaces working, but not perfectly. What are you having problems with?
Advertisement
Maybe iam rendering it wrong?
Here is my code for rendering(Iam rendering the whole world no bsp traveling)

for(int i=0;i {
if(i>0)
{
if(FaceList.Shader!=FaceList[i-1].Shader)
glBindTexture(GL_TEXTURE_2D,(FaceList.Shader+1));<br> }<br> else glBindTexture(GL_TEXTURE_2D,(FaceList.Shader+1));<br><br><br> glBegin(GL_TRIANGLES);<br> int felem=FaceList.FirstElmt;<br> int numelem=FaceList.NumElmts;<br><br><br> for(int j=0;j<numelem;j++)<br> {<br> <br> glTexCoord2fv(VertexList[FaceList.FirstVert+ElementList[felem+j]].TexCoords);<br> glVertex3fv(VertexList[FaceList.FirstVert+ElementList[felem+j]].Position);<br> }<br> glEnd();<br> }<br><br>Is this the right way to do it?<br>I also use glScalef(0.1,0.1,0.1) on the modelview.<br><br>Should i do anything with the texture matrix?<br> </i> <br><br>Edited by - Enouk on February 25, 2002 2:43:59 PM
You shouldnt have to do anything with the texture coordinates within the bsp file, as they are correct. Im loading and rendering a BSP file in one of my projects, and I just render the vertices like so:

  glMultiTexCoord2fvARB(GL_TEXTURE0_ARB,v->st);glMultiTexCoord2fvARB(GL_TEXTURE1_ARB,v->lightmap);glVertex3fv(v->xyz);  


v is a pointer to the drawVert_t struct (similar to the struct you pasted in your post, except the ''int color'' in yours should be a 4 element byte array).

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
the cureved surfaces in quake3 are bezier patches u will need to build the triangles from these, ie the curves contain no triangles

http://uk.geocities.com/sloppyturds/gotterdammerung.html

This topic is closed to new replies.

Advertisement