Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Rotation bugfix

  • Loading branch information...
commit 99c50a1611b048b38bc4bdb2480f9023b87b677b 1 parent 505dbaf
Mihkel Sokk authored November 07, 2012
0  img/texture/night8192.jpg → img/texture/earth_night_2048.jpg
File renamed without changes
4  index.html
@@ -14,8 +14,10 @@
14 14
     <script src="js/main.js"></script>
15 15
     <div id="star"></div>
16 16
     <div id="about">
17  
-      I'm Mihkel, a developer from Estonia?
  17
+      Mihkel Sokk
18 18
       <br>
  19
+      Ruby & Javascript developer
  20
+      Beginner Creative Coder
19 21
       With a passion for creative coding?
20 22
       <br>
21 23
       More concise text and layout here...
16  js/main.js
... ...
@@ -1,7 +1,7 @@
1 1
 /**
2 2
  * Deep, deep in WIP!
3 3
  */
4  
-if(!Detector.webgl) { Detector.addGetWebGLMessage(); }
  4
+if(!Detector.webgl) Detector.addGetWebGLMessage();
5 5
 
6 6
 var w = window.innerWidth
7 7
   , h = oldH = window.innerHeight
@@ -27,7 +27,7 @@ document.body.appendChild(renderer.domElement);
27 27
 
28 28
 
29 29
 
30  
-var planetTexture = THREE.ImageUtils.loadTexture('img/texture/night8192.jpg')
  30
+var planetTexture = THREE.ImageUtils.loadTexture('img/texture/earth_night_2048.jpg')
31 31
   , cloudsTexture = THREE.ImageUtils.loadTexture('img/texture/earth_clouds_1024.png');
32 32
 
33 33
 
@@ -40,7 +40,7 @@ planet.rotation.z = tilt;
40 40
 scene.add(planet);
41 41
 
42 42
 planet.on('mouseover', function() {
43  
-  if(window.zoomOutTween) { window.zoomOutTween.stop(); }
  43
+  if(window.zoomOutTween) window.zoomOutTween.stop();
44 44
   stopped = true;
45 45
   clock.stop();
46 46
 
@@ -54,10 +54,10 @@ planet.on('mouseover', function() {
54 54
     co: cloudMaterial.opacity
55 55
   }).to({
56 56
     px: 1.035,
57  
-    py: (planet.rotation.x - (planet.rotation.x % 6.28)) + 4.28,
  57
+    py: (planet.rotation.y - (planet.rotation.y % 6.28)) + 4.28,
58 58
     pz: 0,
59 59
     cx: 1.035,
60  
-    cy: (planet.rotation.x - (planet.rotation.x % 9.42)) + 4.28,
  60
+    cy: (planet.rotation.y - (planet.rotation.y % 6.28)) + 4.28,
61 61
     cz: 0,
62 62
     co: .3
63 63
   }, 2500)
@@ -130,6 +130,7 @@ clouds.rotation.z = tilt;
130 130
 clouds.scale.set(1.005, 1.005, 1.005);
131 131
 scene.add(clouds);
132 132
 
  133
+// SETUP END
133 134
 
134 135
 animate();
135 136
 function animate() {
@@ -139,8 +140,9 @@ function animate() {
139 140
 
140 141
     var delta = clock.getDelta();
141 142
 
142  
-    planet.rotation.y += 0.1 * delta;
143  
-    clouds.rotation.y += 0.15 * delta;
  143
+
  144
+    planet.rotation.y += .1 * delta;
  145
+    clouds.rotation.y += .15 * delta;
144 146
   }
145 147
   renderer.render(scene, camera);
146 148
   TWEEN.update();

0 notes on commit 99c50a1

Please sign in to comment.
Something went wrong with that request. Please try again.