From b5008e323366447582a414aeecbadf2f8bd2b3b6 Mon Sep 17 00:00:00 2001 From: Wayou Liu Date: Mon, 3 Nov 2014 17:02:12 +0800 Subject: [PATCH] cannot access width & height directly from a geometry cannot access width & height directly from a geometry but via the parameters property in three.js r69 --- chapter-02/01-basic-scene.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 +