KevinBLT Posted April 11, 2016 Share Posted April 11, 2016 Hello everyone, in my application, I normally only need to render the 3D view after the user has changed some settings of the confugration or the view is being used (with either the mouse , finger or keyboard) the rest of the time no rendering is needed. But how can I know if Babylon is doing something that needs? For example: Can I look somewhere if the camera has stopped moving? (Especially when it's deaccelerating) Or an animation is running? Thanks for your answer! Kevin Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 11, 2016 Share Posted April 11, 2016 Hey Kevin, by default you will ask the engine to runRenderLoop() for you. Inside this render loop most of the time, you only run : scene.render() This is where you can turn rendering on/off by calling/not calling scene.render() based on your code Quote Link to comment Share on other sites More sharing options...
KevinBLT Posted April 12, 2016 Author Share Posted April 12, 2016 That's what I did so far :-) But this forces me to check all events again and I still don't if the camera is moving or not. Because of that I always have to render 3 or more seconds after mouseup. But it's not exact. I think Babylon internally has the informations I need but I don't know where. Quote Link to comment Share on other sites More sharing options...
KevinBLT Posted April 12, 2016 Author Share Posted April 12, 2016 I have found what I looked for :-) View3D.prototype.onRender = function onRender(force) { var cam = this.camera; if (cam.inertialAlphaOffset || cam.inertialBetaOffset || cam.inertialRadiusOffset || cam.inertialPanningX || cam.inertialPanningY || force) { this.scene.render(); } } This will only render on demand! :-) Thanks. PS: How can I set this topic to "Solved" ? prvi_treti 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 12, 2016 Share Posted April 12, 2016 No way to mark it as solved unfortunately Can ou just add [Solved] to the title? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.