提交 ce7ffe1d 编写于 作者: D Don McCurdy

[gltf] Fix use of lines primitive.

上级 426e23f2
......@@ -1812,7 +1812,7 @@ THREE.GLTF2Loader = ( function () {
// For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.
var elementBytes = TypedArray.BYTES_PER_ELEMENT;
var itemBytes = elementBytes * itemSize;
var byteStride = json.bufferViews[accessor.bufferView].byteStride;
var byteStride = json.bufferViews[ accessor.bufferView ].byteStride;
var array;
// The buffer is not interleaved if the stride is the item size in bytes.
......@@ -2328,17 +2328,13 @@ THREE.GLTF2Loader = ( function () {
geometry.setIndex( dependencies.accessors[ primitive.indices ] );
meshNode = new THREE.LineSegments( geometry, material );
} else {
meshNode = new THREE.Line( geometry, material );
}
meshNode = new THREE.LineSegments( geometry, material );
} else {
throw new Error( "Only triangular and line primitives are supported" );
throw new Error( 'Only triangular and line primitives are supported' );
}
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
# Outlined Box
## Screenshot
![screenshot](screenshot.png)
## License Information
Donated by @twittmann for glTF testing.
......@@ -483,6 +483,16 @@
// TODO: 'glTF-MaterialsCommon', 'glTF-techniqueWebGL'
extensions: ['glTF', 'glTF-Embedded', 'glTF-pbrSpecularGlossiness', 'glTF-Binary']
},
{
name : 'Outlined Box',
url : './models/gltf/OutlinedBox/OutlinedBox.gltf',
cameraPos: new THREE.Vector3(0, 5, 15),
objectScale: new THREE.Vector3(0.01, 0.01, 0.01),
objectRotation: new THREE.Euler(0, 90, 0),
addLights:true,
shadows:true,
extensions: ['glTF']
},
];
function buildSceneList() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册