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:
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user