提交 b7818a43 编写于 作者: M Mr.doob

Fixed TeapotBufferGeometry.

上级 857d9e57
......@@ -26,7 +26,7 @@
*
* Note that the bottom (the last four patches) is not flat - blame Frank Crow, not me.
*
* The teapot should normally be rendered as a double sided object, since for some
* The teapot should normally be rendered as a double sided object, since for some
* patches both sides can be seen, e.g., the gap around the lid and inside the spout.
*
* Segments 'n' determines the number of triangles output.
......@@ -505,13 +505,13 @@ THREE.TeapotBufferGeometry = function ( size, segments, bottom, lid, body, fitLi
var notDegenerate = function ( vtx1, vtx2, vtx3 ) {
// if any vertex matches, return false
return ! ( ( ( vertices[ vtx1 * 3 ] === vertices[ vtx2 * 3 ] ) &&
return ! ( ( ( vertices[ vtx1 * 3 ] === vertices[ vtx2 * 3 ] ) &&
( vertices[ vtx1 * 3 + 1 ] === vertices[ vtx2 * 3 + 1 ] ) &&
( vertices[ vtx1 * 3 + 2 ] === vertices[ vtx2 * 3 + 2 ] ) ) ||
( ( vertices[ vtx1 * 3 ] === vertices[ vtx3 * 3 ] ) &&
( ( vertices[ vtx1 * 3 ] === vertices[ vtx3 * 3 ] ) &&
( vertices[ vtx1 * 3 + 1 ] === vertices[ vtx3 * 3 + 1 ] ) &&
( vertices[ vtx1 * 3 + 2 ] === vertices[ vtx3 * 3 + 2 ] ) ) ||
( ( vertices[ vtx2 * 3 ] === vertices[ vtx3 * 3 ] ) &&
( ( vertices[ vtx2 * 3 ] === vertices[ vtx3 * 3 ] ) &&
( vertices[ vtx2 * 3 + 1 ] === vertices[ vtx3 * 3 + 1 ] ) &&
( vertices[ vtx2 * 3 + 2 ] === vertices[ vtx3 * 3 + 2 ] ) ) );
......@@ -721,7 +721,7 @@ THREE.TeapotBufferGeometry = function ( size, segments, bottom, lid, body, fitLi
}
this.addAttribute( 'index', new THREE.IndexBufferAttribute( indices, 1 ) );
this.addIndex( new THREE.BufferAttribute( indices, 1 ) );
this.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
......
......@@ -161,7 +161,7 @@
// skybox scene - keep camera centered here
sceneCube = new THREE.Scene();
sceneCube.add( skybox );
// scene itself
scene = new THREE.Scene();
......@@ -364,7 +364,7 @@
teapot.geometry.dispose();
scene.remove( teapot );
}
var teapotGeometry = new THREE.TeapotBufferGeometry( teapotSize,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册