Help bro. I use three.js raycaster() function to intersect a Object3D in the Group, but it return nothing....and the raycaster() can intersect with the THREE.mesh if I put a mesh into the scene, SO Does it means that the raycaster() function can't support the import Object?
code to intersect on the click event
function onMouseClick(event) {
mouse.x = ((event.clientX - canvas.getBoundingClientRect().left) / canvas.offsetWidth) * 2 - 1;
mouse.y = - ((event.clientY - canvas.getBoundingClientRect().top) / canvas.offsetHeight) * 2 + 1;
raycaster.setFromCamera(mouse, camera);
var clickobjstore = raycaster.intersectObjects(huojia.children[0], true);
console.log(clickobjstore);
for (var i = 0; i < clickobjstore.length; i++) {
console.log(clickobjstore);
clickobjstore[i].object.material.color.set(0xff0000);
}
renderer.render(scene, camera);
}
img of the group object on console