threepipe
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SimplifyModifierPlugin.md 1.1KB


prev:

text: 'GLTFMeshOptDecodePlugin'
link: './GLTFMeshOptDecodePlugin'

next:

text: 'MeshOptSimplifyModifierPlugin'
link: './MeshOptSimplifyModifierPlugin'

SimplifyModifierPlugin

ExampleSource CodeAPI Reference

Boilerplate for implementing a plugin for simplifying geometries. This is a base class and cannot be used directly.

A sample to use it:

class SimplifyModifierPluginImpl extends SimplifyModifierPlugin {
  protected _simplify(geometry: IGeometry, count: number) {
    return new SimplifyModifier().modify(geometry, count) as IGeometry
  }
}

const plugin = viewer.addPluginSync(new SimplifyModifierPluginImpl())

const root = await viewer.load('file.glb')
plugin.simplifyAll(root, {factor: 0.75})

Check the example for full implementation.