Page 1 of 1

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

Posted: Tue Nov 06, 2007 12:16 pm
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 =(

Posted: Tue Nov 06, 2007 3:13 pm
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.