浏览代码

Flipped sides of ShapeGeometry. Make canvas_geometry_shapes compatible with FrontSide. see #2422

zz85 13 年之前
父节点
当前提交
2a826b2eec
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      examples/canvas_geometry_shapes.html
  2. 2 2
      src/extras/geometries/ShapeGeometry.js

+ 2 - 2
examples/canvas_geometry_shapes.html

@@ -277,10 +277,10 @@
 				addShape( triangleShape, 0xffee00, -180, 0, 0, 0, 0, 0, 1 );
 				addShape( triangleShape, 0xffee00, -180, 0, 0, 0, 0, 0, 1 );
 				addShape( roundedRectShape, 0x005500, -150, 150, 0, 0, 0, 0, 1 );
 				addShape( roundedRectShape, 0x005500, -150, 150, 0, 0, 0, 0, 1 );
 				addShape( squareShape, 0x0055ff, 150, 100, 0, 0, 0, 0, 1 );
 				addShape( squareShape, 0x0055ff, 150, 100, 0, 0, 0, 0, 1 );
-				addShape( heartShape, 0xff1100, 0, 100, 0, Math.PI, 0, 0, 1 );
+				addShape( heartShape, 0xff1100, 40, 100, 0, 0, 0, Math.PI, 1 );
 				addShape( circleShape, 0x00ff11, 120, 250, 0, 0, 0, 0, 1 );
 				addShape( circleShape, 0x00ff11, 120, 250, 0, 0, 0, 0, 1 );
 				addShape( fishShape, 0x222222, -60, 200, 0, 0, 0, 0, 1 );
 				addShape( fishShape, 0x222222, -60, 200, 0, 0, 0, 0, 1 );
-				addShape( smileyShape, 0xee00ff, -270, 250, 0, Math.PI, 0, 0, 1 );
+				addShape( smileyShape, 0xee00ff, -200, 250, 0, 0, 0, Math.PI, 1 );
 				addShape( arcShape, 0xbb4422, 150, 0, 0, 0, 0, 0, 1 );
 				addShape( arcShape, 0xbb4422, 150, 0, 0, 0, 0, 0, 1 );
 				addShape( splineShape, 0x888888, -50, -100, 0, 0, 0, 0, 0.2 );
 				addShape( splineShape, 0x888888, -50, -100, 0, 0, 0, 0, 0.2 );
 
 

+ 2 - 2
src/extras/geometries/ShapeGeometry.js

@@ -123,9 +123,9 @@ THREE.ShapeGeometry.prototype.addShape = function ( shape, options ) {
 
 
 		face = faces[ i ];
 		face = faces[ i ];
 
 
-		var a = face[ 2 ] + shapesOffset;
+		var a = face[ 0 ] + shapesOffset;
 		var b = face[ 1 ] + shapesOffset;
 		var b = face[ 1 ] + shapesOffset;
-		var c = face[ 0 ] + shapesOffset;
+		var c = face[ 2 ] + shapesOffset;
 
 
 		this.faces.push( new THREE.Face3( a, b, c, null, null, material ) );
 		this.faces.push( new THREE.Face3( a, b, c, null, null, material ) );
 		this.faceVertexUvs[ 0 ].push( uvgen.generateBottomUV( this, shape, options, a, b, c ) );
 		this.faceVertexUvs[ 0 ].push( uvgen.generateBottomUV( this, shape, options, a, b, c ) );