In order to know the current front face of a rotating cube I created a raycaster telling me which part of the cube intersects with it. So far I do not get any intersections although I think I did everything correct.

How can this be solved?

Thanks

有帮助吗?

解决方案

You need to have your raycaster's ray point toward the object.

//var projector = new THREE.Projector(); 
var vector = cube.position.clone(); // new THREE.Vector3(100, 100, 0.5);
//projector.unprojectVector(vector, camera);

fiddle: http://jsfiddle.net/an86j/19/

Note: This question is not likely to be of use to anyone else but you, and that is not the purpose of this site. Try to ask questions that will be beneficial to others. See the faq.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top