How to create a dynamic texture

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Peppe
Posts: 16
Joined: Wed Aug 08, 2007 5:12 pm

How to create a dynamic texture

Post by Peppe »

Hi, to all! My Name is Giuseppe and I write from Italy :D . I have a question about Irrlicht and the textures. I want to create a dynamic texturing system for my terrain, but I don't know the procedures to create it. For example, I have a "brush", and I paint my terrain, with different textures (ES: grass, sand, rock, etc.). :)

Can you help me?

Thank you very much.

PS: Excuse me, if I committed many grammar mistakes, but I know only little bit of this language.
Bleck
Posts: 2
Joined: Mon Aug 06, 2007 2:44 pm

Post by Bleck »

First load any "empty" texture.
Then use the getColorFormat() function of texture to get the color format and lock() function to get pointer to pixels.
Also load the texture of grass, sand... and do the same.

Now it's up to you to calculate the position of "brush" and blend the fragment of grass/sand/rock into the main texture.

After this (painting) unlock() all textures.

Maybe I will paste some code later :wink:
We all gonna die...
Peppe
Posts: 16
Joined: Wed Aug 08, 2007 5:12 pm

Post by Peppe »

Thank you, bleck :D ! I tryng it soon :D !

bye :)
Peppe
Posts: 16
Joined: Wed Aug 08, 2007 5:12 pm

Post by Peppe »

Ehm...I Tryed it, but the program don't work :( . Do you give me a sample code, please? :)

Thank you :D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, this is the wrong way. First you prove that you did something by showing your code (partially please, only the important stuff) and your understanding of the errors. Then we can help you much better and it's not so frustrating for all of us.
Post Reply