我從其中加載了gltf模型的A-Frame School中獲取代碼。然後我裝從Khronos的,this box的樣本模型,並試圖加載它,但我得到這個錯誤(多次)(A-Frame)local gltf不會加載;無法讀取未定義的屬性「切片」
GLTFLoader.js:979 Uncaught (in promise) TypeError: Cannot read property 'slice' of undefined
at GLTFLoader.js:979
at i (GLTFLoader.js:570)
at GLTFLoader.js:975
at <anonymous>
我可以加載的obj模型,並試圖模型的多個版本,但總是得到錯誤。
示例代碼在本地工作,這意味着它正確加載模型,從aframe cdn中獲取它。
繼承人的完成
<!DOCTYPE html>
<html>
<head>
<title>glTF Model</title>
<meta name="description" content="glTF Model">
<script src="https://rawgit.com/aframevr/aframe/b395ea0/dist/aframe-master.min.js"></script>
</head>
<body>
<a-scene>
<a-assets>
<a-asset-item id="boxModel" src="Box.gltf"></a-asset-item>
</a-assets>
<a-gltf-model src="#boxModel"></a-gltf-model>
</a-scene>
</body>
</html>