Skip to content

Commit f889c70

Browse files
committed
moved camera.lookAt func call out of animate loop for better fps
1 parent 1155d1b commit f889c70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyscriptjs/examples/webgl/raycaster/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
uSpeed = 0.1
159159

160160
time = 0.0003;
161+
camera.lookAt(scene.position)
161162

162163
while True:
163164
time = performance.now() * 0.0003;
@@ -186,7 +187,6 @@
186187
modularGruop.rotation.y -= ((mouse.x * 4) + modularGruop.rotation.y) * uSpeed;
187188
modularGruop.rotation.x -= ((-mouse.y * 4) + modularGruop.rotation.x) * uSpeed;
188189

189-
camera.lookAt(scene.position)
190190
renderer.render( scene, camera )
191191
await asyncio.sleep(0.02)
192192

0 commit comments

Comments
 (0)