Hello everyone? . How to subdivide GLTF model?
code:
var subdivisions = 2;
var modifier = new SubdivisionModifier(subdivisions);
new GLTFLoader().load(
objPath,
function (gltf) {
gltf.scene.traverse((o) => {
if (o.isMesh) {
o.geometry = modifier.modify(o.geometry);
scene.add(o);
}
});
)
error:
TypeError: Cannot read property ‘length’ of undefined
at SubdivisionModifier.smooth