Hi to all !.
I would like to create a 3D viewer for a proprietary cad format.
These cad models are often very large with many elements.
created a file containing the unique objects (mesh and submesh) converted into single glb files that are then dynamically imported into a ThreeJS scene duplicating each instance and applying rotation/translation matrix.
In this way the format on disk remains quite compact.
The basic functions that I would like to obtain are:
- highlighting of one or more elements,
- transparency of one or more elements,
- show/hide of one or more elements
- I don’t need to manage textures
In this first version I preload the “meshes” with GLTFLoader (DRACOLoader and MeshoptDecoder) putting them (the single gltf scene) in a javascript Map, then I add the different instances cloning the “Mesh” (.clone() of the original gltf scene) of the map and setting rotation and translation
Model example in legacy windows viewer:
Using the gtlf importer each single cad object is composed of a Threejs object3D and many meshes for each material:
it would be better to use the “BufferGeometry .groups” ?
Using the “instanced Meshes” does not seem to be feasible because then I would not be able to manage the transparency:
or am I wrong? I would like to make each single object transparent independently from the others
This is my first test: