【发布时间】:2019-04-12 04:57:52
【问题描述】:
将嵌入式组件添加到场景以更轻松地为我的 AR 场景中的元素设置样式时,raycast/click 事件不会在正确的位置触发。当我从场景中删除嵌入标签时,光线投射会正常工作,但在移动设备上查看网页时,场景中的对象处于不同的比例/位置。
有没有办法在嵌入式场景中进行适当的光线投射?
<body style="margin: 0px; overflow: hidden">
<a-scene embedded arjs="debugUIEnabled: false; sourceType: webcam">
<a-marker type='pattern' url='custommarkers/pattern-marker.patt' cursor="rayOrigin: mouse; fuse: false">
<a-circle id="button" src="#buttonimg" radius=".2" rotation="-90 0 0" position="0 0 1">
<a-animation begin="buttonpressed" dur="750" attribute="scale" to="2 4 4" direction="alternate"></a-animation>
</a-circle>
</a-marker>
</a-scene>
</body>
“buttonpressed”是按钮被点击时发送的事件。我可以点击“按钮”,但不能点击圆圈图形所在的位置
【问题讨论】: