PDA

View Full Version : texture mapping - help!



selcux
12-24-2005, 12:01 PM
I generate terrain with texture. Everthing is ok
but after that I am trying to add skybox but the problem occurs here. When I put a texture for skybox the texture is mapped on the terrain. I thing there is something with binding textures. But I could not find any solutions.
Can anyone knows this problem?

Ehsan Kamrani
12-25-2005, 02:35 AM
When you want to specify the properties of your sky texture, you should use from the function glBindTexture() . As an example

in your init code:
glBindTexture( GL_TEXTURE_2D, SkyTexture );
//glTexParameter()
//glTexImage2D()
...

And in your draw code, you use from the following code:

glBindTexture( GL_TEXTURE_2D, SkyTexture );
//Draw The sky box

there's the same manner for the terrain texture:
in your init code:
glBindTexture( GL_TEXTURE_2D, TerrainTexture );
//glTexParameter()
//glTexImage2D()
...
and in your draw function:

glBindTexture( GL_TEXTURE_2D, TerrainTexture );
//Draw your terrain

Merry christmas & happy new year
-Ehsan-