Topic: how deform a mesh?

hello, i see the documentation but not found how make this, i need deform a mesh (vertex) in runtime, thanks.

Re: how deform a mesh?

In c++, you can access the mesh of an entity (or the meshs of a scene).
From an entity :

        // mesh
        MMesh * mesh = entity->getMesh();
        if(! mesh)
                return;

        // sub-meshs
        unsigned int s, sSize = mesh->getSubMeshsNumber();
        for(s=0; s<sSize; s++)
        {
                MSubMesh * subMesh = &mesh->getSubMeshs()[s];

                // vertices
                MVector3 * vertices = subMesh->getVertices();
                if(! vertices)
                        continue;

                unsigned int v, vSize = subMesh->getVerticesSize();
                for(v=0; v<vSize; v++)
                        vertices[v] += MVector3(1, 0, 0); // ex : translate
        }

        mesh->updateBoundingBox();

Re: how deform a mesh?

Also, depending on what you want to do, you can just use a vertex shader.

Re: how deform a mesh?

i want change a terrain in realtime, i will be try this code, thankyou very much.