# Pause Renderloop with ArcRotateCamera

**URL:** <https://forum.babylonjs.com/t/pause-renderloop-with-arcrotatecamera/23754>\
**Category:** Questions\
**Created:** [September 11, 2021, 5:04pm UTC](https://forum.babylonjs.com/t/pause-renderloop-with-arcrotatecamera/23754 "2021-09-11T17:04:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![olli2home](https://avatars.discourse-cdn.com/v4/letter/o/7ab992/32.png) [@olli2home](https://forum.babylonjs.com/u/olli2home)\
**Post date:** [September 11, 2021, 5:04pm UTC](https://forum.babylonjs.com/t/pause-renderloop-with-arcrotatecamera/23754/1 "2021-09-11T17:04:44Z")

</div>

Hi there,

I want to pause rendering if there has been no change in the scene. A similar question has already been asked and answered here ([https://playground.babylonjs.com/#31SIHA#1](https://playground.babylonjs.com/#31SIHA#1)). However, a “FreeCamera” was used there. In my case ([https://playground.babylonjs.com/#31SIHA#2](https://playground.babylonjs.com/#31SIHA#2)) an “ArcRotateCamera” should be used.  
I want the rendering to be active as long as the camera is moving. Since the camera still moves after releasing the mouse button, I don’t know where to start or which event to query.

---

<div class="post-metadata">

**Author:** ![Faber](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/faber/32/15884_2.png) [@Faber](https://forum.babylonjs.com/u/Faber)\
**Post date:** [September 12, 2021, 12:38am UTC](https://forum.babylonjs.com/t/pause-renderloop-with-arcrotatecamera/23754/2 "2021-09-12T00:38:44Z")

</div>

Hm. I am more surprised that it works with a **`FreeCamera`** than that it doesn’t with an **`ArcRotateCamera`**. If you listen to camera movement to know when to stop rendering the scene, then how can you know when to start rendering again, since the scene is not rendered anymore ?  
I thought **`camera.inputs.attached.keyboard.checkInputs()`** was the reason why (around line 42), but actually, when you comment this line, the playground with the free cam works just the same… 😕

Also [I logged **`camera.cameraRotation`** here](https://playground.babylonjs.com/#31SIHA#3) (end of the code) and it always returns zero values, even while you’re rotating the camera.

So at this point, I’m thinking : either this is a bug related to **`ArcRotateCamera`** , and the property **`camera.rotation`** inherited from **`TargetCamera`** isn’t working as expected, or I am not understanding some fundamental mechanic about how **`ArcRotateCamera`** are working.

I believe @Cedric or @PolygonalSun are experienced with cameras, do you guys have an insight for us ? 🙂

---

<div class="post-metadata">

**Author:** ![Blake](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/blake/32/21509_2.png) [@Blake](https://forum.babylonjs.com/u/Blake)\
**Post date:** [September 12, 2021, 4:00am UTC](https://forum.babylonjs.com/t/pause-renderloop-with-arcrotatecamera/23754/3 "2021-09-12T04:00:38Z")

</div>

Here’s a [playground](https://playground.babylonjs.com/#31SIHA#6) example that only renders the scene if the camera’s projection matrix, view matrix, or mesh target changes. Their observables are used to track changes and the render loop only renders the scene if one of them has changed. It also logs the count of rendered frames so that we can watch the console log as we’re moving/zooming/rotating/resizing/re-targeting for verification. IDK if there’s a better/easier way to check if the camera’s dirty, but this seems to work well…

---

<div class="post-metadata">

**Author:** ![olli2home](https://avatars.discourse-cdn.com/v4/letter/o/7ab992/32.png) [@olli2home](https://forum.babylonjs.com/u/olli2home)\
**Post date:** [September 12, 2021, 12:04pm UTC](https://forum.babylonjs.com/t/pause-renderloop-with-arcrotatecamera/23754/4 "2021-09-12T12:04:16Z")

</div>

Great!

It was of course clear that it would be so easy once again. 🙂
