@@ -62,11 +62,6 @@ Examples
6262 // Create the 3D scene; find the HTML canvas and pass it
6363 // to Scene3D.
6464 var scene= new Scene3D (document .getElementById (" canvas" ));
65- // Set the perspective view. Camera has a 45-degree field of view
66- // and will see objects from 0.1 to 100 units away.
67- scene .setPerspective (45 ,scene .getClientAspect (),0.1 ,100 );
68- // Move the camera back 40 units.
69- scene .setLookAt ([0 ,0 ,40 ]);
7065 // Create a box mesh 10 units in width, 20 units
7166 // in height, and 20 units in depth
7267 var mesh= Meshes .createBox (10 ,10 ,10 );
@@ -80,6 +75,11 @@ Examples
8075 var timer= {};
8176 // Set up the render loop
8277 GLUtil .renderLoop (function (time ){
78+ // Set the perspective view. Camera has a 45-degree field of view
79+ // and will see objects from 0.1 to 100 units away.
80+ scene .setPerspective (45 ,scene .getClientAspect (),0.1 ,100 );
81+ // Move the camera back 40 units.
82+ scene .setLookAt ([0 ,0 ,40 ]);
8383 // Adjust x-rotation
8484 rotation[0 ]= 360 * GLUtil .getTimePosition (timer,time,6000 );
8585 // Adjust y-rotation
0 commit comments