Skip to content
This repository was archived by the owner on Aug 12, 2026. It is now read-only.
This repository was archived by the owner on Aug 12, 2026. It is now read-only.

Performance when using TrackballControls #14

Description

@alfonsomunozpomer

Hi,

First of all congratulations on pulling off such a great project!

I was having a look at https://github.com/toxicFork/react-three-renderer-example/blob/master/src/examples/WebGLCameraExample/index.js and in my tests, the line controls.addEventListener(change, () => { introduces a noticeable performance hit. My guess is that setState makes the scene be rendered twice: once by this.controls.update(); inside _onAnimate and then again by the render method.

What’s to lose if we comment out the controls.addEventListener(change, () => { method, besides the camera position in the state (which from what I can tell is only used when the view is initially rendered)?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions