我正试图用raycaster在飞机上画画。
我知道如何在raycaster和飞机相交时得到通知,但在此之后我不知道如何获得更新的交叉路口坐标,同时raycaster在飞机上移动。
AFRAME.registerComponent('raycaster-listen', {
init: function () {
this.raycaster = document.querySelector('#myRay');
},
tick: function () {
var intersection = this.raycaster.components.raycaster.getIntersection(this.el);
if (!intersection) { return; }
console.log(intersection);
}
});
<a-entity geometry material raycaster-listen></a-entity>