Accessing Decimator Directly

The section “Accessing the simplification class directly” in the documentation post:
https://doc.babylonjs.com/how_to/in-browser_mesh_simplification

talks about accessing the simplification class directly. However, this does not work:

var decimator = new QuadraticErrorSimplification(meshToDecimate);

and neither does

var decimator = new BABYLON.QuadraticErrorSimplification(meshToDecimate);

I am looking to simplify a mesh, regardless of distance and post TypeError: BABYLON.GUI.GUIImage is not a constructor - Questions & Answers - HTML5 Game Devs Forum covers precisely this - however the code does not seem to comply.

All simplification demos stopped working. I guess it’s no longer a part of the official API, thou I’m not 100% sure about it.

The class stopped being exported starting at commit 581d5053c9805ca369e77a542b63a5cfba4de864 on 2018/09/20: More code comments · BabylonJS/Babylon.js@581d505 · GitHub

The reason is unclear as the message of the commit is “More code comments” :slight_smile:

They are supposed to work :slight_smile:
@RaananW can you have a look (pretty please)?

Will do :slight_smile:

1 Like

Thanks a ton

2 Likes

Merged! you rock!

Still having an issue with this: Playground:

https://playground.babylonjs.com/#TL1IIB#52

Lines 57-77

https://playground.babylonjs.com/#TL1IIB#53

So much profit in one scene! :slight_smile:

(you forgot the BABYLON namespace)

Thank you - it’s fixed in the playground.

For my local project, all I did was add this import to my html file:

<script src="https://cdn.babylonjs.com/babylon.js"></script>

Getting error:

TypeError: "BABYLON.QuadraticErrorSimplification is not a constructor"

you will need to use preview.babylonjs.com instead of cdn.babylonjs.com

2 Likes

That did it. Thank you for all your help

1 Like