Mapping a texture for a terrain
How do u map one single texture over your whole terrain??
I am using the code from OpenGL Lesson 35
Go check out Flipcode''s articles... They have a LOT of different stuff on terrain that may interest
you. (www.flipcode.com)
------------------------------
Trent (ShiningKnight)
E-mail me
OpenGL Game Programming Tutorials
you. (www.flipcode.com)
------------------------------
Trent (ShiningKnight)
E-mail me
OpenGL Game Programming Tutorials
also checkout www.vterrain.org
btw if the terrain is reasonably big having just the one texture is gonna look like crap
btw if the terrain is reasonably big having just the one texture is gonna look like crap
When you use glTexCoord*d and have values bigger than 1 as arguments, the texture will be repeated.
for example
glTexCoord2d(1,1) stretches the texture (or compresses it) over the whola area of your polygon.
glTexCoord2D(100,100) repeats the texture 100 times over the area...
hope it makes sense
--Spencer
for example
glTexCoord2d(1,1) stretches the texture (or compresses it) over the whola area of your polygon.
glTexCoord2D(100,100) repeats the texture 100 times over the area...
hope it makes sense
--Spencer
quote:Original post by ShiningKnight
Go check out Flipcode's articles... They have a LOT of different stuff on terrain that may interest
you. (www.flipcode.com)
------------------------------
Trent (ShiningKnight)
E-mail me
OpenGL Game Programming Tutorials
And GameDev.net doesn't?
To answer the question, you need to calculate individual texture coordinates for each vertex. I would suggest looking at NeHe's flag demo (busy at work and can't go indepth at the moment here).
Kevin
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement