Advertisement

Terrain Texture Problem

Started by February 14, 2003 05:54 AM
3 comments, last by WildFuse 22 years ago
Hi all How can I stretch my texture over my whole height map rendered terrain ?? I tried plotting the tex coords to the four corners of the terrain, but no luck. Any ideas ? I have been trying this for quite a while and cannot get it right. thanks
hey...

I did it that way. I used the Grayscale image, you are using for your Hightmapping, as the actual texture. All you need to do is color it however you want it colored and loop trough each vertex like you do with your heightmap. And then assign each texture vertex.

arkansas

Advertisement
That is not the problem, the problem is I didnt want to tile the texture, I needed one texture for the whole terrain, it is very detailed.

all you do is take your x and y pos in rendering and divide it by the map size then generate your texture coordinates.

It works very well, I will post a screenie soon.
You have to set your texture coords like this: (ej.)

tu = (1.0f/HEIGHT_MAP_SIZE_X)*NumVertexX
tv = (1.0f/HEIGHT_MAP_SIZE_Y)*NumVertexY

Hope this help

If God with me, Who against me?
--------------------------------------------- If God with me, Who against me?Personal Web Samuel Prince Blog...
quote:
Original post by WildFuse

all you do is take your x and y pos in rendering and divide it by the map size then generate your texture coordinates.

It works very well, I will post a screenie soon.


You have answered Your own question, i presume

This topic is closed to new replies.

Advertisement