Is it possible to get the new, simplified mesh from Mesh.simplify() as a returned variable? My goal is to simplify a mesh, get the simplified mesh as a variable, and reuse it (cloning or instancing)
I thought that mesh from successCallback() would be the new, simplified mesh, but it’s always undefined for me despite the mesh being successfully simplified (visually verified) in the rendered scene…
In the Babylon.js source, I think I see where the newMesh is, but it’s not returned for us to use externally: Source for runSimplification()
And if you want to vary the parameters of the QuadraticErrorSimplification, you’ll need to call it directly. Note that the simplification occurs asynchronously and takes a few seconds to appear. Set up the sphere in the callback since sphere3 won’t be valid until the callback happens (asynchronously).
You’re welcome. I worked this out a while ago, but your post spurred me to clean it up and (it turns out) generalize to the point where you probably could substitute any function that implements ISimplifier, though I’m not aware of any others.