2 textures on the same ms3d model
2 textures on the same ms3d model
I've got a ms3d model, I display it without problem in my bsp world. there are 2 textures :
one for the head and an other one for the body.
I can not apply these textures on my model in the same time.
This is my code :
scene::IAnimatedMesh* mesh = 0;
mesh = smgr->getMesh("../../media/perso2.ms3d");
if (mesh)
{
perso2 = smgr->addAnimatedMeshSceneNode(mesh);
scene::ISceneNodeAnimator* perso2_col = smgr->createCollisionResponseAnimator(
selector, perso2, core::vector3df(10,10,10),
core::vector3df(0,-100,0), 100.0f,
core::vector3df(0,0,0));
perso2->addAnimator(perso2_col);
perso2_col->drop();
if (perso2)
{
perso2->setPosition(core::vector3df(-70,-30,-60));
perso2->setAnimationSpeed(20);
perso2->setMaterialTexture(0, device->getVideoDriver()->getTexture("../../media/perso2_corps.bmp"));
perso2->setMaterialTexture(1, device->getVideoDriver()->getTexture("../../media/perso2_tete.bmp"));
perso2->setMaterialFlag(video::EMF_LIGHTING, true);
perso2->addShadowVolumeSceneNode();
}
}
Sam.
Ps : I converted a half-life model to a milkshape model
one for the head and an other one for the body.
I can not apply these textures on my model in the same time.
This is my code :
scene::IAnimatedMesh* mesh = 0;
mesh = smgr->getMesh("../../media/perso2.ms3d");
if (mesh)
{
perso2 = smgr->addAnimatedMeshSceneNode(mesh);
scene::ISceneNodeAnimator* perso2_col = smgr->createCollisionResponseAnimator(
selector, perso2, core::vector3df(10,10,10),
core::vector3df(0,-100,0), 100.0f,
core::vector3df(0,0,0));
perso2->addAnimator(perso2_col);
perso2_col->drop();
if (perso2)
{
perso2->setPosition(core::vector3df(-70,-30,-60));
perso2->setAnimationSpeed(20);
perso2->setMaterialTexture(0, device->getVideoDriver()->getTexture("../../media/perso2_corps.bmp"));
perso2->setMaterialTexture(1, device->getVideoDriver()->getTexture("../../media/perso2_tete.bmp"));
perso2->setMaterialFlag(video::EMF_LIGHTING, true);
perso2->addShadowVolumeSceneNode();
}
}
Sam.
Ps : I converted a half-life model to a milkshape model
Try not assigning a texture to the model as it may load all necessary textures if they are in the same directory of the model. Multitexturing may have some problems but I'm sure that you can load a model with two textures. Anyway it would be nice to know what is being said by the console output, see if there's any errors.
David
David
Yes, that feature is missing, and it would be good if it would work. Maybe I`ll add this in 0.4.1, but I cannot promise it.
Last edited by niko on Mon Sep 15, 2003 10:45 am, edited 1 time in total.
I 've got a solution :
I create 2 meshs (body.sm3d, head.sm3d ), i apply a texture for each mesh.
and i attach them with this tips :
http://irrlicht.sourceforge.net/docu/cl ... de.html#a6
Sam.
I create 2 meshs (body.sm3d, head.sm3d ), i apply a texture for each mesh.
and i attach them with this tips :
http://irrlicht.sourceforge.net/docu/cl ... de.html#a6
Sam.
I've just stumbled across this issue myself.. though I am using 2 meshes. on fot he head and the other for the body, the problem happens when I want to put on red gloves (Example) and take off the blue ones, or I don't want to wear gloves at all.
The head mesh will just replaced with either a helmet or will the the user chosen one, so the material(s) won't change much, but on the body boots, armour, gloves, leg wear.. etc..(think Anarchy Online'ish) Heck I'd even like the option to blend in another texture, to show battle damage (but that might be asking too much from my skills )
Is multitexturing planned, if so what mesh formats are going to support that, 3ds, Ms3d, obj...if it isn't planned for awhile does any one have a workaround or full solution...
If the above example is confusing that is because I ran out of coffee, and even drank the last months flat Coke
The head mesh will just replaced with either a helmet or will the the user chosen one, so the material(s) won't change much, but on the body boots, armour, gloves, leg wear.. etc..(think Anarchy Online'ish) Heck I'd even like the option to blend in another texture, to show battle damage (but that might be asking too much from my skills )
Is multitexturing planned, if so what mesh formats are going to support that, 3ds, Ms3d, obj...if it isn't planned for awhile does any one have a workaround or full solution...
If the above example is confusing that is because I ran out of coffee, and even drank the last months flat Coke
Project Admin -
http://shadowrunonline.sourceforge.net
------------------------------------
There are 10 kinds of people, those that understand binary and those that don't.
http://shadowrunonline.sourceforge.net
------------------------------------
There are 10 kinds of people, those that understand binary and those that don't.
-
- Posts: 271
- Joined: Sat Aug 23, 2003 5:52 pm
- Location: Hurricane Central, Florida
LOOK IT"S EASY... You need to merge your 2 texture files into 1 file.
I use Paint Shop Pro 7, just create a new image that is big enough to put both of your textures in. Then open both of your texture files also, cut them out and paste them onto the new image so that you have one image that has both textures on it. Save it.
Now, open up Milkshape (BTW... this is in the Milkshape help file, check the index under textures). You will need to select a group, assign it a material (texture from file), select the area of the image to use as the texture for the currently selected group, and then fit the wireframe of the group to that area of the texture. Do the same for your other group(s) and save the model.
Then in your code just call aand BAM. If I was not clear enough, check out that help file... it's in there.
I use Paint Shop Pro 7, just create a new image that is big enough to put both of your textures in. Then open both of your texture files also, cut them out and paste them onto the new image so that you have one image that has both textures on it. Save it.
Now, open up Milkshape (BTW... this is in the Milkshape help file, check the index under textures). You will need to select a group, assign it a material (texture from file), select the area of the image to use as the texture for the currently selected group, and then fit the wireframe of the group to that area of the texture. Do the same for your other group(s) and save the model.
Then in your code just call a
Code: Select all
perso2->setMaterialTexture(0, device->getVideoDriver()->getTexture("../../media/ONE_TEXTURE_FILE.bmp"));
ummm, i dont want to do one texture wrapped that way because my 3DML format allow people to change the texture on parts - so they can say:
<PART name="leaves" texture="green.png"/>
<PART name="trunk" texture="maplebark.png"/>
and then they can also change textures on the fly in the markup scripting
so i guess that was a yes, that IRRLICHT only allows one texture per model and does not have a notion of parts/materials? is that planned - it feels like a show stopper for me - i was all excited too to port over to this engine and use the collision and other nice features ...
<PART name="leaves" texture="green.png"/>
<PART name="trunk" texture="maplebark.png"/>
and then they can also change textures on the fly in the markup scripting
so i guess that was a yes, that IRRLICHT only allows one texture per model and does not have a notion of parts/materials? is that planned - it feels like a show stopper for me - i was all excited too to port over to this engine and use the collision and other nice features ...