two textures on one model & 3ds-models intersection chec

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
kkray
Posts: 4
Joined: Sun Nov 04, 2007 10:04 am
Location: kaliningrad, russia
Contact:

two textures on one model & 3ds-models intersection chec

Post by kkray »

Hello again. Thanks for all who help me yesterday, you are the best!
How can i check for collision with 2 3ds-models? And with 2 cubeSceneNode's ?
Be sure, i read tutorial about collision, but answers for my questions (in my opinion) in this tutorial was not explained well.

And second question: Can I use on one model two or more textures (bottom texture must be visible under top texture)? I want to use this for draw logo and bullet holes on cars in my "game". I try:

node->setMaterialTexture(0,frame0);
node->setMaterialTexture(1,frame1);

where frame0 has transparent zones (png) and frame1 is bmp-texture without transparency. But this code doesn't work =(
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

As to your second question: to set two textures to your material is not enough. You have to tell your material that he actually should use both of them and way you want. This is done by changing material type. Look API for video::E_MATERIAL_TYPE. Default material is EMT_SOLID which use only first layer texture. You probably want EMT_SOLID_2_LAYER or similar.

You can change it individually via SMaterial interface with MaterialType attribute or via ISceneNode interface with setMaterialType() function for whole node.
Post Reply