diff --git a/chapter-02/01-basic-scene.html b/chapter-02/01-basic-scene.html index e8606b91..2e4034da 100644 --- a/chapter-02/01-basic-scene.html +++ b/chapter-02/01-basic-scene.html @@ -106,9 +106,9 @@ // position the cube randomly in the scene - cube.position.x=-30 + Math.round((Math.random() * planeGeometry.width)); + cube.position.x=-30 + Math.round((Math.random() * (planeGeometry.width||planeGeometry.parameters.width))); cube.position.y= Math.round((Math.random() * 5)); - cube.position.z=-20 + Math.round((Math.random() * planeGeometry.height)); + cube.position.z=-20 + Math.round((Math.random() * (planeGeometry.height||planeGeometry.parameters.height))); // add the cube to the scene scene.add(cube); @@ -168,4 +168,4 @@ - \ No newline at end of file +