-
Texture Map coordinates
Hi, below is my code and texture not showing. please help. thanks
yConst = -300;
for (x=-300; x < 300; x+=5)
for (z=600; z > -600; z-=5)
{
glTexCoord3f(0.0,1.0); glVertex3f( x, yConst, z); //Top Left glTexCoord3f(0.0,0.0); glVertex3f(x+5, yConst, z);// Bottom Left glTexCoord3f(1.0,0.0); glVertex3f(x+5, yConst, z-5);// Bottom Right
glTexCoord3f(1.0,1.0); glVertex3f( x, yConst, z-5);// Top Right
}
-
Senior Member
OpenGL Pro
Re: Texture Map coordinates
The above code is not the whole necessary code to display a texture and should not even compile since you call glTexCoord3f with 2 parameters and it takes 3 ones.
Moreover, glBegin/glEnd calls lack or are not included in the above piece of code IMO.
For more information about texture mapping, read this if it is not already done:
http://www.opengl.org/wiki/index.php/Texture_Mapping
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules