Skip to content

Commit

Permalink
Examples: Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Jun 2, 2021
1 parent 0ef04d2 commit f286b73
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/webgl_refraction.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,17 @@

requestAnimationFrame( animate );

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

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

smallSphere.position.set(
Math.cos( timer * 0.1 ) * 30,
Math.abs( Math.cos( timer * 0.2 ) ) * 20 + 5,
Math.sin( timer * 0.1 ) * 30
Math.cos( time ) * 30,
Math.abs( Math.cos( time * 2 ) ) * 20 + 5,
Math.sin( time ) * 30
);
smallSphere.rotation.y = ( Math.PI / 2 ) - timer * 0.1;
smallSphere.rotation.z = timer * 0.8;
smallSphere.rotation.y = ( Math.PI / 2 ) - time;
smallSphere.rotation.z = time * 8;

renderer.render( scene, camera );

Expand Down

0 comments on commit f286b73

Please sign in to comment.