|
@@ -58,9 +58,9 @@
|
|
|
object.scale.x = Math.random() * 2 + 1;
|
|
|
object.scale.y = Math.random() * 2 + 1;
|
|
|
object.scale.z = Math.random() * 2 + 1;
|
|
|
- object.rotation.x = ( Math.random() * 360 ) * Math.PI / 180;
|
|
|
- object.rotation.y = ( Math.random() * 360 ) * Math.PI / 180;
|
|
|
- object.rotation.z = ( Math.random() * 360 ) * Math.PI / 180;
|
|
|
+ object.rotation.x = Math.random() * 2 * Math.PI;
|
|
|
+ object.rotation.y = Math.random() * 2 * Math.PI;
|
|
|
+ object.rotation.z = Math.random() * 2 * Math.PI;
|
|
|
scene.add( object );
|
|
|
|
|
|
}
|
|
@@ -114,9 +114,9 @@
|
|
|
.easing( TWEEN.Easing.Elastic.Out).start();
|
|
|
|
|
|
new TWEEN.Tween( intersects[ 0 ].object.rotation ).to( {
|
|
|
- x: ( Math.random() * 360 ) * Math.PI / 180,
|
|
|
- y: ( Math.random() * 360 ) * Math.PI / 180,
|
|
|
- z: ( Math.random() * 360 ) * Math.PI / 180 }, 2000 )
|
|
|
+ x: Math.random() * 2 * Math.PI,
|
|
|
+ y: Math.random() * 2 * Math.PI,
|
|
|
+ z: Math.random() * 2 * Math.PI }, 2000 )
|
|
|
.easing( TWEEN.Easing.Elastic.Out).start();
|
|
|
|
|
|
}
|
|
@@ -149,11 +149,11 @@
|
|
|
|
|
|
TWEEN.update();
|
|
|
|
|
|
- theta += 0.2;
|
|
|
+ theta += 0.1;
|
|
|
|
|
|
- camera.position.x = radius * Math.sin( theta * Math.PI / 360 );
|
|
|
- camera.position.y = radius * Math.sin( theta * Math.PI / 360 );
|
|
|
- camera.position.z = radius * Math.cos( theta * Math.PI / 360 );
|
|
|
+ camera.position.x = radius * Math.sin( THREE.Math.degToRad( theta ) );
|
|
|
+ camera.position.y = radius * Math.sin( THREE.Math.degToRad( theta ) );
|
|
|
+ camera.position.z = radius * Math.cos( THREE.Math.degToRad( theta ) );
|
|
|
camera.lookAt( scene.position );
|
|
|
|
|
|
renderer.render( scene, camera );
|