Procedural Textures: how can i apply them to an object?

Started by andretti, April 14, 2005, 09:18:54

Previous topic - Next topic

andretti

Hi, i've found a lot of code about creating a procedural textures, but still i don't have any idea of how to apply them to a terrain surface (or any other kind of 3d object). I think the sequence should be this:

-create an empty texture
-bind the texture
-for every triangle in my surface redraw the texture passing the coordinate to a function which draws my texture
-apply the current texture to the triangle using the classical textCoords method

I think, but i'm not sure, that this should be the right sequence. Can somebody tell me if i'm right and then post some simple and clear code in which a procedural texture is created and then applied? Thank you very much (i apologize about my poor english!!)