我只想尝试将Sketchfab中的3D模型添加到此场景中,但我无法找到有关如何执行此操作的简单教程。这是代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Peachtree Corners Veterans Monument - A-Frame</title>
<meta name="description" content="Peachtree Corners Veterans Monument!">
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
<script src="https://button.glitch.me/button.js"></script>
</head>
<body>
<a-scene>
<a-sky src="https://cdn.glitch.com/0dd56231-cb65-46f8-ad38-225931845e77%2Fsky1.jpg?1528307112422"></a-sky>
</a-scene>
<div class="glitchButton"></div>
</body>
</html>
这是我要上传的sketchfab模型:https://sketchfab.com/models/729e5bc464454b5099445538e7785a19#
答案 0 :(得分:1)
使用gltf-model
组件 - documentation
从sketchfab下载zip,有两个文件:scene.gltf
,scene.bin
和textures
文件夹,请确保它们位于同一目录中,然后加载模型:< / p>
<a-assets>
<a-asset-item id="scene" src="/path/to/scene.gltf"></a-asset-item>
</a-assets>
<a-entity gltf-model="#scene"></a-entity>