Hi,
Raycast is not intersecting/colliding with the sprite in AR.
Workflow - I have empty gameobject/nodes in my model, I have placed the sprites on these empty nodes. I have added sprites under a group and tried to perform raycast, in normal mode raycast is colliding with the sprites whereas in AR mode the raycast is not colliding. Any help is much appreicated.
Sprite :
group = new THREE.Group();
for(var i=0;i<model.children.length;i++){
if(model.children[i].type == "Object3D"){
spriteMaterial = new THREE.SpriteMaterial({ map, opacity: 1, transparent: true,depthTest: false,depthWrite: false,sizeAttenuation : false});
sprite = new THREE.Sprite( spriteMaterial );
sprite.position.copy(model.children[i].position).multiplyScalar(1);
sprite.scale.set(1, 1, 1).multiplyScalar(1/36);
sprite.name = "node name";
group.add(layer);
}
}
Raycast :
mouse.x = 0;
mouse.y = 0;
raycaster = new THREE.Raycaster();
raycaster.setFromCamera( mouse, camera );var intersects =
raycaster.intersectObjects(group.children, true);
if (intersects.length > 0){
console.log(intersects);
}