|
@@ -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);
|