Jump to content

Determine if render draw is needed [SOLVED]


KevinBLT
 Share

Recommended Posts

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

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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" ?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...