Can i access to an object in a .my3d scene ?
I have a my3d scene (a temple) and i would like for exemple to change the texture of one wall (i have a lot of walls in that scene but i want to change properties of only ONE object in that scene).
Is it possible or a whole my3d scene is just one entity (one big object) ?
Thanks
Eviral
Accessing one object in a whole my3d scene ?
-
- Posts: 370
- Joined: Mon Aug 29, 2005 10:54 pm
- Location: http://web.utk.edu/~pfox1
I've never used My3d, is it like a model format (like 3ds, ms3d, x, etc..)?
If so, yeah, you should be able to edit quite a few of its parameters at runtime.
To edit material information:
node->getMaterial(index).Whatever = WhateverYouWant;
node->getMaterial(10).Texture1 = driver->getTexture(t_path.c_str());
node->getMaterial(4).EmissiveColor = Color;
etc.. etc...
Note that in your example, if multiple walls use that material, then all of them will change. I recomend using a specific texture on the wall that you want changed, I noticed Irrlicht combines mesh buffers that share materials in ms3d so this may be the case with my3d as well.
If so, yeah, you should be able to edit quite a few of its parameters at runtime.
To edit material information:
node->getMaterial(index).Whatever = WhateverYouWant;
node->getMaterial(10).Texture1 = driver->getTexture(t_path.c_str());
node->getMaterial(4).EmissiveColor = Color;
etc.. etc...
Note that in your example, if multiple walls use that material, then all of them will change. I recomend using a specific texture on the wall that you want changed, I noticed Irrlicht combines mesh buffers that share materials in ms3d so this may be the case with my3d as well.
-
- Posts: 322
- Joined: Tue Aug 30, 2005 10:34 am
- Location: slovakia