javascript - Three.js raycaster.intersectObjects() get empty array -
i tried make world map three.js, , find https://github.com/ftorghele/worldmap, needed. updated three.js , d3.js version according awesome project, have problem on last step mousemove country name
var vector = new three.vector3( mouse.x, mouse.y, 1 ); this.projector.unprojectvector( vector, this.camera ); var raycaster = new three.ray( this.camera.position, vector.subself( this.camera.position ).normalize() ); var intersects = raycaster.intersectobjects( this.scene.children );
i think should change like
let vector = new three.vector3(mouse.x, mouse.y, 1); let raycaster = new three.raycaster(); raycaster.setfromcamera(vector, this.camera); let intersects = raycaster.intersectobjects(this.scene.children, true);
but intersects empty array.
the content of (this.scene.children)
thanks!
Comments
Post a Comment