ThreeJS: is it possible to simplify an object / re

2020-07-14 09:22发布

问题:

I'm starting to learn ThreeJS. I have some very complex models to display.

These models come from Autocad files that my customer provides.

But sometimes the amount of details in the model is just way too much for the purpose of the website.

I would like to reduce the amount of vertexes in the model to simplify the display and enhance performance.

Is this possible from within ThreeJS? Or is there maybe an other solution for this?

回答1:

There's a modifier called SimplifyModifier that works very well. You'll find it in the Three.js examples

https://threejs.org/examples/#webgl_modifier_simplifier



回答2:

If you can import the model into Blender, you could try Decimate Modifier. In the latest version of Blender, it features three different methods with configurable "amount" parameters. Depending on your mesh topology, it might reduce the poly count drastically with virtually no visual changes, or it might completely break the model with even a slight reduction attempt. Other 3d packages should include a similar functionality, but I've never used those.

.

Another thing that came into mind: Sometimes when I've encountered a too high-poly Blender model, a good start has been checking if it has a Subdivision Modifier applied and removing that if so. While I do not know if there's something similar in Autocad, it might be worth investigating.



回答3:

I updated SimplifyModifier function. it works with Textured models. Here is example:

https://rigmodels.com/3d_LOD.php?view=5OOOEWDBCBR630L4R438TGJCD

you can extract JS codes and use in your project.