Hey there, I'm just starting out with three.js and would really appreciate any guidance.
I have a gltf model where multiple parts come together to form a single model. My goal is to select the entire model as one entity, but when using raycaster for selection, it only picks up individual parts.
For example, imagine I have a cube and when hovering over it, only one face gets selected at a time.
Below you'll find my code... Any assistance is welcome
var raycaster = new Raycaster();
loader.load("Purplelogo/Purplelogo.gltf", ( gltf ) => {
scene.add( gltf.scene );
gltf.scene.position.set(2,-0.9,1);
gltf.scene.scale.set(0.9,0.9,0.9);
gltf.scene.rotation.set(2,2,5);
});
raycaster.setFromCamera( mouse, camera );
var intersects2 = raycaster.intersectObjects( scene2.children, true );
for ( var i = 0; i < intersects2.length; i++ ) {
intersects2[ i ].object.rotateX(3)
}