Browse Source

Merge branch 'BoxGeometry-docs' of https://github.com/IceCreamYou/three.js into dev

Mr.doob 11 years ago
parent
commit
4d56f4cda5

+ 18 - 18
docs/api/extras/geometries/BoxGeometry.html

@@ -8,39 +8,39 @@
 	</head>
 	<body>
 		[page:Geometry] &rarr;
-		
+
 		<h1>[name]</h1>
 
-		<div class="desc">todo</div>
+		<div class="desc">BoxGeometry is the quadrilateral primitive geometry class. It is typically used for creating a cube or irregular quadrilateral of the dimensions provided with the 'width', 'height', and 'depth' constructor arguments.</div>
 
 		<h2>Example</h2>
 
-		<code>todo</code>
+		<code>var geometry = new THREE.BoxGeometry( 1, 1, 1 );
+		var material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
+		var cube = new THREE.Mesh( geometry, material );
+		scene.add( cube );
+		</code>
 
 		<h2>Constructor</h2>
 
 
-		<h3>todo</h3>
-		<div></div>
-
-
-		<h2>Properties</h2>
-
-		<h3>todo</h3>
+		<h3>[name]([page:Float width], [page:Float height], [page:Float depth], [page:Integer widthSegments], [page:Integer heightSegments], [page:Integer depthSegments])</h3>
 		<div>
-		todo
-		</div> 
+		width — Width of the sides on the X axis.<br />
+		height — Height of the sides on the Y axis.<br />
+		depth — Depth of the sides on the Z axis.<br />
+		widthSegments — Optional. Number of segmented faces along the width of the sides. Default is 1.<br />
+		heightSegments — Optional. Number of segmented faces along the height of the sides. Default is 1.<br />
+		depthSegments — Optional. Number of segmented faces along the depth of the sides. Default is 1.
+		</div>
 
 
-		<h2>Methods</h2>
-		
+		<h2>Properties</h2>
 
-		<h3>todo</h3>
-		<div>todo</div>
 		<div>
-		todo
+		Each of the constructor parameters is accessible as a property of the same name. Any modification of these properties after instantiation does not change the geometry.
 		</div>
-		
+
 		<h2>Source</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

+ 5 - 5
docs/api/objects/Mesh.html

@@ -15,14 +15,14 @@
 
 
 		<h2>Example</h2>
-		
-		<code>var geometry = new THREE.CubeGeometry( 1, 1, 1 );
+
+		<code>var geometry = new THREE.BoxGeometry( 1, 1, 1 );
 		var material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
 		var mesh = new THREE.Mesh( geometry, material );
 		scene.add( mesh );
 		</code>
 
-				
+
 		<h2>Constructor</h2>
 
 		<h3>[name]( [page:Geometry geometry], [page:Material material] )</h3>
@@ -53,8 +53,8 @@
 		<div>
 		Returns the index of a morph target defined by name.
 		</div>
-		
-		
+
+
 		<h3>.updateMorphTargets()</h3>
 		<div>
 		Updates the morphtargets to have no influence on the object.

+ 3 - 3
docs/manual/introduction/Creating-a-scene.html

@@ -65,7 +65,7 @@
 		<div><em>"That's all good, but where's that cube you promised?"</em> Let's add it now.</div>
 
 		<code>
-		var geometry = new THREE.CubeGeometry(1,1,1);
+		var geometry = new THREE.BoxGeometry(1,1,1);
 		var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
 		var cube = new THREE.Mesh( geometry, material );
 		scene.add( cube );
@@ -73,7 +73,7 @@
 		camera.position.z = 5;
 		</code>
 
-		<div>To create a cube, we need a <strong>CubeGeometry</strong>. This is an object that contains all the points (<strong>vertices</strong>) and fill (<strong>faces</strong>) of the cube. We'll explore this more in the future.</div>
+		<div>To create a cube, we need a <strong>BoxGeometry</strong>. This is an object that contains all the points (<strong>vertices</strong>) and fill (<strong>faces</strong>) of the cube. We'll explore this more in the future.</div>
 
 		<div>In addition to the geometry, we need a material to color it. Three.js comes with several materials, but we'll stick to the <strong>MeshBasicMaterial</strong> for now. All materials take an object of properties which will be applied to them. To keep things very simple, we only supply a color attribute of <strong>0x00ff00</strong>, which is green. This works the same way that colors work in CSS or Photoshop (<strong>hex colors</strong>).</div>
 
@@ -130,7 +130,7 @@
 					renderer.setSize(window.innerWidth, window.innerHeight);
 					document.body.appendChild(renderer.domElement);
 
-					var geometry = new THREE.CubeGeometry(1,1,1);
+					var geometry = new THREE.BoxGeometry(1,1,1);
 					var material = new THREE.MeshBasicMaterial({color: 0x00ff00});
 					var cube = new THREE.Mesh(geometry, material);
 					scene.add(cube);