Scaling a convex mesh

wraith

15-06-2009 00:39:51

I'm trying to scale a convex mesh at runtime. I'm creating multiple instances of an object, each scaled differently. After creation I use:

object->getSceneNode()->scale();

to set the size of the actual mesh, but I can't figure out how to dynamically scale the convex mesh. I've tried creating a convex object and using

convex->getBlueprint()->mSize=newsize;

but that doesn't work. Any help would be appreciated.

betajaen

15-06-2009 05:37:53

No, your second piece of code will never work.

Convex scaling is a little tricky to implement into the generic mesh class at the moment, although it's easily done. A "scale" function would only work for 1 out of the 5 meshes, which is difficult to communicate to the user, using the mesh class in their project. Thinking that they can quickly scale TriangleMeshes will be quickly disappointed.

If your mesh is manageable(i.e. < 50 vertices) and easily creatable in code. Create one in a function with a ManualMesh, and just scale the coordinates when you need to.