創建場景中的錯誤是Uncaught TypeError: Cannot read property 'opacity' of undefined
上three.js所:12917three.js所使用的異常時sceneLoader裝載由three.js所編輯
我使用的場景文件是:
{
"metadata": {
"version": 4.3,
"type": "Object",
"generator": "ObjectExporter"
},
"geometries": [
{
"uuid": "7F5BC6A2-4B74-4049-8AF8-40A5EF310430",
"type": "CubeGeometry",
"width": 100,
"height": 100,
"depth": 100,
"widthSegments": 1,
"heightSegments": 1,
"depthSegments": 1
}],
"materials": [
{
"uuid": "95D0C78A-2066-4A8D-9F46-73B3038E55DE",
"type": "MeshBasicMaterial",
"color": 16777215,
"opacity": 1,
"transparent": false,
"wireframe": false
}],
"object": {
"uuid": "E0E0DAAE-012A-49DB-BC1B-2878BCA7F0DA",
"type": "Scene",
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],
"children": [
{
"uuid": "E60D8291-4E35-4365-A98E-7AEA1D1D433F",
"name": "Cube 1",
"type": "Mesh",
"geometry": "7F5BC6A2-4B74-4049-8AF8-40A5EF310430",
"material": "95D0C78A-2066-4A8D-9F46-73B3038E55DE",
"matrix": [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]
}]
}
}
我查過了,它確實加載成功,並且是有效的JSON(JSONLint); 我還測試了JSONLoader以成功加載JSON模型。 我似乎在使用the latest version。這個場景是在THREE.js編輯器中創建的,恐怕我不知道如何在它之外創建一個場景。