2
0
Эх сурвалжийг харах

Docs: Fix the example to actually render a cube (#24120)

* Fix the example to actually render a cube

Live example in JSFiddle works fine so I took the BoxGeometry arguments from there.

* Update Creating-a-scene.html

Co-authored-by: mrdoob <[email protected]>
Oskar Laska 3 жил өмнө
parent
commit
c03a6e8898

+ 2 - 2
docs/manual/en/introduction/Creating-a-scene.html

@@ -70,7 +70,7 @@
 		<p><em>"That's all good, but where's that cube you promised?"</em> Let's add it now.</p>
 
 		<code>
-		const geometry = new THREE.BoxGeometry();
+		const geometry = new THREE.BoxGeometry( 1, 1, 1 );
 		const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
 		const cube = new THREE.Mesh( geometry, material );
 		scene.add( cube );
@@ -138,7 +138,7 @@
 					renderer.setSize( window.innerWidth, window.innerHeight );
 					document.body.appendChild( renderer.domElement );
 
-					const geometry = new THREE.BoxGeometry();
+					const geometry = new THREE.BoxGeometry( 1, 1, 1 );
 					const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
 					const cube = new THREE.Mesh( geometry, material );
 					scene.add( cube );