aframe

Add polygon in A-frame

醉酒当歌 提交于 2019-11-27 07:32:14
问题 Is there a way to add polygon in A-frame? Kinda like: <a-entity geometry="primitive:polygon;positions:x y z, ..., x y z;"> </a-entity> ? Thanks. 回答1: There used to be a polygon-component, but it doesn't work with 0.5.0 or 0.6.0. So you have to make your own in three.js, by creating a component which adds a mesh to your entity: let points = []; //vertices of Your shape points.push( new THREE.Vector2( 0, 0 ) ); points.push( new THREE.Vector2( 3, 0 ) ); points.push( new THREE.Vector2( 5, 2 ) );

How to detect when a marker is found in AR.js

…衆ロ難τιáo~ 提交于 2019-11-27 07:07:03
问题 I'm trying to detect when a marker if found/lost in ar.js, while using a-frame. From what I see in the source code, when the marker is found, a 'getMarker' event should be fired, moreover artoolkit seems to dispatch a markerFound event. I tried to listen to those events on the <a-scene> , or on the <a-marker> , but it seems I'm either mistaken, or i need to get deeper to the arController , or arToolkit objects. When i log the scene, or the marker, i only get references to the attributes,