Reputation: 248
I'm trying to use the raycaster to draw on a plane.
I know how to be notified when the raycaster and the plane intersect but after that i don't know how to get updated coordinates of the intersection while the raycaster is moving acrosse the plane.
Upvotes: 0
Views: 101
Reputation: 13233
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>
Upvotes: 1