Skip to content

Commit f286b73

Browse files
committed
Examples: Clean up.
1 parent 0ef04d2 commit f286b73

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/webgl_refraction.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,17 @@
156156

157157
requestAnimationFrame( animate );
158158

159-
refractor.material.uniforms.time.value += clock.getDelta();
159+
const time = clock.getElapsedTime();
160160

161-
const timer = Date.now() * 0.01;
161+
refractor.material.uniforms.time.value = time;
162162

163163
smallSphere.position.set(
164-
Math.cos( timer * 0.1 ) * 30,
165-
Math.abs( Math.cos( timer * 0.2 ) ) * 20 + 5,
166-
Math.sin( timer * 0.1 ) * 30
164+
Math.cos( time ) * 30,
165+
Math.abs( Math.cos( time * 2 ) ) * 20 + 5,
166+
Math.sin( time ) * 30
167167
);
168-
smallSphere.rotation.y = ( Math.PI / 2 ) - timer * 0.1;
169-
smallSphere.rotation.z = timer * 0.8;
168+
smallSphere.rotation.y = ( Math.PI / 2 ) - time;
169+
smallSphere.rotation.z = time * 8;
170170

171171
renderer.render( scene, camera );
172172

0 commit comments

Comments
 (0)