augmented-reality - 桌面(chrome)aframe ar 失败;相机工作但没有盒子或模型不知道会发生什么
问题描述
以下是 aframe 博客上的示例代码。结果仅显示相机图像;没有盒子也没有模型:不知道会发生什么。模型在那里,js 库在那里。我应该在相机图像的某处看到盒子和模型吗?
<!DOCTYPE html>
<html>
<head>
<!-- include A-Frame obviously -->
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
<script src="js/ColladaLoader.js"></script>
<!-- include ar.js for A-Frame -->
<script src="https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"></script>
</head>
<body style=’margin : 0px; overflow: hidden;’>
<a-scene
embedded arjs=’sourceType: webcam;’>
<!-- create your content here. just a box for now -->
<a-box position='0 0.5 0' material='opacity: 1 scale = "2 2 2" color="red";'
>
</a-box>
<!-- define a camera which will move according to the marker position -->
<a-entity camera
>
</a-entity>
<a-marker preset=’hiro’>
</a-marker>
<a-collada-model
id = "titlexx1b"
src="models/man_default.dae" position = "1 1 1"
scale = "1 1 1"
>
</a-collada-model>
</a-scene>
</body>
</html>
解决方案
您应该将盒子和模型添加到要放置它们的标记上。在这种情况下,hiro 标记。通常,不建议在一个标记上放置多个对象。另一件事是,我不确定 A-frame / AR.js 是否支持 DAE 文件。考虑使用支持的格式。
推荐阅读
- python - Calculate head-to-head statistics using Pandas
- c++ - Where do I store cross platform C++ app storage?
- azure - 如果事件计数大于 X,Azure 日志分析查询以显示计算机
- c# - REST api does not Return Values in SmartObject tester
- ios - 重置 ARView 并再次运行指导叠加
- xml - Powershell Convert to time
- hdl - How to define output Reg in Chisel properly
- java - Can't generate RSAPublicKey in JAVA
- javascript - 为什么我的区间从我的变量中扣除了一个奇怪的总和?
- hyperledger-fabric - 订购者交易检查点