I’m loading a model using objloader and my model include several child geometries.
I would like to project an image on the model same as demonstrated in the decal example (https://threejs.org/examples/webgl_decals.html)
however when I’m trying to add the decal on the model, the decal object expect to get a mesh with geometry, and my model object contains several child geometrie and this is not working. if I’m using only one of the child geometries it is working - but then the projection is not correct as it should be projected on all.
how can I support the child geometries when using decal?
You would have to enhance the implementation of DecalGeometry to support meshes with children. Instead of doing this, have you tried to merge your object hierarchy into a single mesh?
not really an option…
I’ve got an obj model with textures (mtl).
I’m using the ObjLoader to load it - it’s output is an object which don’t have geometry property - but child objects. each child object has geometry (BufferGeometry)
I found the web samples for merging geometries but non of them handle the materials.
any idea how to do it properly?
You might want to check out BufferGeometryUtils.mergeBufferGeometries(). The second parameter useGroups can be used to generate groups for the merged geometry. Groups enable the usage of multiple materials per object.