set texture to specific cube side

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
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

set texture to specific cube side

Post by pera »

I have a white cube, and I want to
- put texture on one of its sides,
- another texture on other side,
- move first texture on another side
- remove second texture

how can this be done in irrlicht? without shaders.
I only know for node->setMaterialTexture(0,texture);
Bate
Posts: 364
Joined: Sun Nov 01, 2009 11:39 pm
Location: Germany

Post by Bate »

You need to do that with a modelling tool. By default a texture wraps around the whole primitive.
Never take advice from someone who likes to give advice, so take my advice and don't take it.
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

I thought there might be some way to specify vertex UV mapping dynamically.

I have another issue: I have simple square plane, loaded as 3ds mesh. no textures. When I try to set texture to this node with

node->setMaterialTexture(0,driver->getTexture("media/terrain/texture.jpg"));

whole scene node gets the color of the first texture pixel. I had problems with this before, what is this issue? Why square texture is not spread on simple square 1 on 1.
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

pera wrote:I have another issue: I have simple square plane, loaded as 3ds mesh. no textures. When I try to set texture to this node with

node->setMaterialTexture(0,driver->getTexture("media/terrain/texture.jpg"));

whole scene node gets the color of the first texture pixel. I had problems with this before, what is this issue? Why square texture is not spread on simple square 1 on 1.
That sounds like the plane doesn't have any UV coordinates, so it's sampling textel (0, 0) the entire time.
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

Right, it seems like its problem with this plane I made in blender. Its just plane I exported to 3ds, but it seems like I have to bark something with materials first.
terier
Posts: 34
Joined: Sun Oct 05, 2008 4:46 pm

Post by terier »

pera wrote:Right, it seems like its problem with this plane I made in blender. Its just plane I exported to 3ds, but it seems like I have to bark something with materials first.
First you must unwrap it. While in edit mode just hit 'U'. Personally I find "smart projections" and "reset" the most useful.
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

Yes, I have absolutely no idea what language is that, but I'll try it :)
Post Reply