问题
I'm importing .3DS models into Blender 2.72b, then exporting them with the Three.js import/export addon. The models have multiple geometry 'islands' (separate groups of connected faces and vertices), each with its own material. I'd like to be able to pair each material with its corresponding island, without having to create separate THREE.Geometry objects. After some digging, I found this question which suggests using a THREE.MeshFaceMaterial to achieve multiple materials for one object. The only problem is that the geometry in that example is a simple cube, whereas my models have hundreds of faces spread across 2-5 islands.
Does Three.js have functionality for identifying geometry 'islands' in a mesh?
回答1:
No. three.js does not have functionality for identifying geometry 'islands' in a mesh.
When using MeshFaceMaterial
, WebGLRenderer
breaks the geometry into chunks anyway -- one chunk for each material. It does that because WebGL supports one shader per geometry.
I would not merge all your geometries, and then use MeshFaceMaterial
, only to have the renderer break the single geometry apart.
You can merge geometries that share a single material if you wish.
three.js r.69
来源:https://stackoverflow.com/questions/26849791/three-js-can-i-detect-geometry-islands-when-importing