PDA

View Full Version : texture stretching



Old GLman
05-25-2002, 01:55 PM
Hi, I have got a horrible problem with texture stretching over a height field. Is there any way to calculate unscaled texture coordinates so I can eliminate the stretch marks!?!

Old GLman

V-man
05-25-2002, 05:46 PM
Textures will always stretch based on from where you view the quad.

If you want to calculate texturing, one method is to use the distance as a parameter.
You know how to do that right?

V-man

Old GLman
05-25-2002, 07:08 PM
Hi, yes, Im working on that now. Im thinking I can go through all my vertices row by row and accumulate the distance between every two consectutive vertices, and set the texture coordinate based on that, then do the same for the columns. Hopefully this should give me the right tex coords for each vertex.

Old GLman

Old GLman
05-26-2002, 11:32 AM
Hi, well I got it working. Still one problem though. When there is a sudden jump in the height field, like a stalagmite, or anything that causes a big increase in height value, it causes the texture to shift just all along that axis of the height field. Its sort of hard to explain. I think its because the sudden jump in height causes a greater total distance to be accumulated, offsetting the entire row. Anybody relate to this? or know how to fix it?

Old GLman