Code to draw multi-texture element , (texture and light)

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
m4tricol
Posts: 11
Joined: Thu Nov 29, 2007 9:18 am

Code to draw multi-texture element , (texture and light)

Post by m4tricol »

Hi all, how set the light and textures parameter to draw a 3d element like this:
Image

with this kind of material, not only one textures:
Image

Ex:

Code: Select all

IAnimatedMesh* mesh = myscene->getMesh("media/mobile.3ds");
IAnimatedMeshSceneNode* node=myscene->addAnimatedMeshSceneNode(mesh);
        
if (node)
     {
        node->setMaterialFlag(EMF_LIGHTING, true); 
        node->setMaterialTexture( 0, mydriver->getTexture("media/textures/parquet.jpg") );       
        node->setMaterialTexture( 2, mydriver->getTexture("media/textures/wall.jpg") ); 

......ecc ...
myscene->addLightSceneNode(0,vector3df(1000,1000,1000),SColorf(1.0f,1.0f,1.0f,1.0f),600.0f);

Thanks
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

you don't need this...
most mesh formats Irrlicht supports (e.g. .x and .3ds) are supporting multi textures...
you just need to load the mesh and then the textures are loaded automaticaly...
just be sure all texture files are in the same folder as the mesh file... ;)
and if you use .3ds files you also have to take care of that the texture file names are in old DOS style (8.3), otherwise they can't be found...

for the lightning you have 2 choices:
either enable lightning and put some light scene nodes into the scene,
or (what I prefere) use the My3D format and create light maps...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Post Reply