How to not stretch the texture.

Hi All,

In my game I have a setting for wall height when creating walls. When I make the walls higher the texture image I use gets stretched and blurry. I would rather if the image didn’t stretch and instead repeated itself. Any ideas how to do that?
I’ve tried setting TextureAttributes as MODULATE, DECAL, BLEND, REPLACE, or COMBINE and it doesn’t seem to make a difference.

I also tried:

Primitive wall = new Box(THICKNESS, height, RADIUS, flags, wallApp, texHeight);

I’m assuming that the Box constructor’s last param (called numTexUnit) is the correct way.

But I still see the texture stretch… :frowning:

The int texHeight is 1 or 2 or 3.

tia

See GL_REPEAT.

He needs to adjust his texcoords too.

Don’t think it is possible to change the texcoords directly on a Box. Could use javax.media.java3d.TexCoordGeneration, change the TextureAttributes transform or create a custom box.

The last param to box has to do with multitexturing, and has nothing to do with the “texHeight”.