This my code in the Default.Html
Page:
<button id="Remove_mesh" class="group">Remove</button>
And this my JS:
var pickResult = scene.pick(offsetX, offsetY);
if (pickResult.pickedMesh) {
if ($('Remove_mesh').click(function(){}))
{
pickResult.dispose();
}
This didn't work
You should use: pickResult.pickedMesh.dispose()
$('Remove_mesh').on("click", function () {
pickResult.pickedMesh.dispose();
});
More info: http://doc.babylonjs.com/page.php?p=24938