Dad72 Posted December 14, 2016 Share Posted December 14, 2016 Hello, How to cancel object that has been simplified like this: mesh.simplify([{distance:300, quality:0.8}, {distance:500, quality:0.5}, {distance:700, quality:0.3}], false, BABYLON.SimplificationType.QUADRATIC); I would like to be able to do the opposite operation for my editor. If a user simplifies an object, I would like it to be able to cancel this simplification. Is this possible, how can one do? Thank you for your help. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 14, 2016 Share Posted December 14, 2016 I do not think so. You can think about cloning the mesh first to save it Adding @RaananW Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 14, 2016 Author Share Posted December 14, 2016 Oh, yes, I did not think about cloning. Ca can be an idea. Unless RaananW is an idea on the subject. Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 15, 2016 Share Posted December 15, 2016 The simplification process adds new meshes to the lod levels of a mesh. The original mesh stays intact, isn't it? So, removing those lod layers with undo the changes you've made when simplifying Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 15, 2016 Author Share Posted December 15, 2016 You mean that I can make a dispose () on objects create? I'll try to do that. Thanks Raanan Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 15, 2016 Author Share Posted December 15, 2016 Yes, it works. Is this the right way to do it ? sphere2.simplify([{ quality: 0.9, distance: 50 }, { quality: 0.5, distance: 80 }, { quality: 0.3, distance: 100 }, { quality: 0.1, distance: 180 }], true, BABYLON.SimplificationType.QUADRATIC, function() { for(var i = 0; i < sphere2._LODLevels.length; i++) { sphere2._LODLevels[i].mesh.dispose(); } sphere2._LODLevels = []; }); Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 16, 2016 Share Posted December 16, 2016 maybe we should add a method to remove LOD levels, but yes, this is a way to do that. Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 16, 2016 Author Share Posted December 16, 2016 One method to do this would actually be good. Thank you RaananW Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.