From f889c70ec775c71c09978f788d092f90340117dc Mon Sep 17 00:00:00 2001 From: Michael Verhulst Date: Wed, 20 Apr 2022 20:47:32 -0500 Subject: [PATCH] moved camera.lookAt func call out of animate loop for better fps --- pyscriptjs/examples/webgl/raycaster/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyscriptjs/examples/webgl/raycaster/index.html b/pyscriptjs/examples/webgl/raycaster/index.html index 2966abd3..33f1a002 100755 --- a/pyscriptjs/examples/webgl/raycaster/index.html +++ b/pyscriptjs/examples/webgl/raycaster/index.html @@ -158,6 +158,7 @@ raycaster = THREE.Raycaster.new(); uSpeed = 0.1 time = 0.0003; +camera.lookAt(scene.position) while True: time = performance.now() * 0.0003; @@ -186,7 +187,6 @@ while True: modularGruop.rotation.y -= ((mouse.x * 4) + modularGruop.rotation.y) * uSpeed; modularGruop.rotation.x -= ((-mouse.y * 4) + modularGruop.rotation.x) * uSpeed; - camera.lookAt(scene.position) renderer.render( scene, camera ) await asyncio.sleep(0.02)