浏览代码

Update ShapeGeometry.html

jox81 11 年之前
父节点
当前提交
f1c65b5067
共有 1 个文件被更改,包括 18 次插入1 次删除
  1. 18 1
      docs/api/extras/geometries/ShapeGeometry.html

+ 18 - 1
docs/api/extras/geometries/ShapeGeometry.html

@@ -13,7 +13,24 @@
 
 
 		<div class="desc">todo</div>
 		<div class="desc">todo</div>
 
 
-
+		<h2>Example</h2>
+		
+		
+		<code>var rectLength = 120, rectWidth = 40;
+		
+		var rectShape = new THREE.Shape();
+		rectShape.moveTo( 0,0 );
+		rectShape.lineTo( 0, rectWidth );
+		rectShape.lineTo( rectLength, rectWidth );
+		rectShape.lineTo( rectLength, 0 );
+		rectShape.lineTo( 0, 0 );
+		
+		var rectGeom = new THREE.ShapeGeometry( rectShape );
+		var rectMesh = new THREE.Mesh( rectGeom, new THREE.MeshBasicMaterial( { color: 0xff0000 } ) ) ;		
+		
+		scene.add( rectMesh );
+		</code>
+	
 		<h2>Constructor</h2>
 		<h2>Constructor</h2>