If you want to implement subdivision in your geometry using Three.js, you can make use of the THREE.SubdivisionModifier. Here's how you can do it:
var modifier = new THREE.SubdivisionModifier(divisions);
// Apply the modifier to your geometry (not mesh).
modifier.modify( geometry );
Please note that this functionality is not built into Three.js by default, so you will need to import it separately. You can download it from here.
UPDATE 1:
When a JSON file is loaded, it becomes an Object3D, acting as a container with a specific structure:
- Object3D
- children (arrays containing meshes representing objects in the scene)
- Mesh (contains information about the geometry that needs modification).
To modify the "geometry", you have to access it like this:
modifier.modify( mesh.children[0].children[0].geometry );
You'll need to apply the modifier to each model in your scene, for example:
modifier.modify( mesh.children[0].children[0].geometry );
modifier.modify( mesh.children[0].children[1].geometry );
modifier.modify( mesh.children[0].children[2].geometry );
This process involves opening containers within containers until you reach the geometry data. I hope this explanation clarifies the procedure for you :)