Archived

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

Mapping a texture for a terrain

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

How do u map one single texture over your whole terrain?? I am using the code from OpenGL Lesson 35

Share this post


Link to post
Share on other sites
also checkout www.vterrain.org
btw if the terrain is reasonably big having just the one texture is gonna look like crap

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites