Problem with scaleMesh() using IMeshManipulator
Posted: Wed Jan 30, 2008 7:49 pm
Hi. I would like to really scale the mesh from the meshbuffer (So I can be calculated right for Creating occtrees and also right for the normals when using dynamic Lighting.
Searched the SDK and found command to do this.
Here is my implementation:
Model is the IAnimatedSceneNode
MeshModel is an IAnimatedMesh
Before doing this, I do a quick test to see if it's defined.
The model is cleared and re-created using the meshbuffer but its not bigger. So it's not doing what I want. (Should be 4 times bigger, but it's not)
Searched the SDK and found command to do this.
Here is my implementation:
Model is the IAnimatedSceneNode
MeshModel is an IAnimatedMesh
Before doing this, I do a quick test to see if it's defined.
Code: Select all
IMeshManipulator * manip = Device->getSceneManager()->getMeshManipulator();
manip->scaleMesh(ModelMesh->getMesh(0),core::vector3df(4.0f,4.0f,4.0f));
manip->recalculateNormals(ModelMesh->getMesh(0),true);
Model->remove();
Model=Device->getSceneManager()->addAnimatedMeshSceneNode(ModelMesh);