• Advertisement

Archived

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

Quake3 textcoords

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

I have written a small quake3 viewer. But the texcoords is not correct,the vertex pos seems fine. Do i have to modify the textcoord in some way, to make the level look like in GtkRadient?

Share this post


Link to post
Share on other sites
Advertisement
Are you using the correct set of texture coords?

There are 2 sets inside the vertex structure, one set being for lightmaps, the other for textures, make sure you are using the right one.

Edited by - terminate on February 24, 2002 7:54:10 PM

Share this post


Link to post
Share on other sites
Yeah i know that,one set for the lightmap to right.

Does it have something to do with the shaders?

I havent looked at those.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yes the textures are upside down , If i divide the coords with 4 it starts to look like something. but still not right. It look like they are repeated a few times

Share this post


Link to post
Share on other sites
Yes the textures are upside down , If i divide the coords with 4 it starts to look like something. but still not right. It look like they are repeated a few times

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
struct Q3_Vertex
{
float Position[3]; ///< Position
float TexCoords[2]; ///< Texcoords of
float LightCoords[2]; ///< Texcoords of
float Normal[3]; ///< Normal
int Color;
};

Its like this. i can post a pic later.

Thanx for your help.

Share this post


Link to post
Share on other sites
That seems to be in order. All I can suggest is that you''re somehow reading in the file incorrectly, or the structure is being padded wrongly by the compiler.

To check this in MSVC++, use this:

  
#pragma pack (push, 1)
struct Q3_Vertex
{
float Position[3]; // Position

float TexCoords[2]; // Texcoords

float LightCoords[2]; // Lightmap coords

float Normal[3]; // Normal

int Color;
};
#pragma pack (pop)


- Pete

Share this post


Link to post
Share on other sites
The lightmaps (for the most part) have nothing to do with shaders. They should render correctly.

By the way, have you had any chance to mess with the curved surfaces? they are giving me hell.

--------------------------

Those who dance are considered insane by those who cannot hear the music.

Share this post


Link to post
Share on other sites
I kinda got curved surfaces working, but not perfectly. What are you having problems with?

Share this post


Link to post
Share on other sites
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[i].Shader+1));
}
else glBindTexture(GL_TEXTURE_2D,(FaceList[i].Shader+1));


glBegin(GL_TRIANGLES);
int felem=FaceList[i].FirstElmt;
int numelem=FaceList[i].NumElmts;


for(int j=0;j {

glTexCoord2fv(VertexList[FaceList[i].FirstVert+ElementList[felem+j]].TexCoords);
glVertex3fv(VertexList[FaceList[i].FirstVert+ElementList[felem+j]].Position);
}
glEnd();
}

Is this the right way to do it?
I also use glScalef(0.1,0.1,0.1) on the modelview.

Should i do anything with the texture matrix?


Edited by - Enouk on February 25, 2002 2:43:59 PM

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

  • Advertisement