File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments