1
0
mirror of https://github.com/pyscript/pyscript.git synced 2022-05-01 19:47:48 +03:00

moved camera.lookAt func call out of animate loop for better fps

This commit is contained in:
Michael Verhulst
2022-04-20 20:47:32 -05:00
parent 1155d1b2ee
commit f889c70ec7

View File

@@ -158,6 +158,7 @@ raycaster = THREE.Raycaster.new();
uSpeed = 0.1 uSpeed = 0.1
time = 0.0003; time = 0.0003;
camera.lookAt(scene.position)
while True: while True:
time = performance.now() * 0.0003; time = performance.now() * 0.0003;
@@ -186,7 +187,6 @@ while True:
modularGruop.rotation.y -= ((mouse.x * 4) + modularGruop.rotation.y) * uSpeed; modularGruop.rotation.y -= ((mouse.x * 4) + modularGruop.rotation.y) * uSpeed;
modularGruop.rotation.x -= ((-mouse.y * 4) + modularGruop.rotation.x) * uSpeed; modularGruop.rotation.x -= ((-mouse.y * 4) + modularGruop.rotation.x) * uSpeed;
camera.lookAt(scene.position)
renderer.render( scene, camera ) renderer.render( scene, camera )
await asyncio.sleep(0.02) await asyncio.sleep(0.02)