Skip to content

TrackballControls does not support on-demand rendering like OrbitControls #30931

Open
@wuyifan0203

Description

@wuyifan0203

Description

TrackballControls does not emit the change event on all interactions (such as mouse wheel zoom), which makes it incompatible with on-demand rendering patterns that work with OrbitControls.

This prevents expected render behavior in performance-sensitive applications.

Reproduction steps

  1. Set up a scene using TrackballControls.
  2. Attach a change event listener to trigger rendering.
  3. Interact with the scene using the mouse wheel to zoom.
  4. Observe that:
    • The change event is not fired.
    • Rendering does not update unless done in a loop.

Code

✅ Works as expected with OrbitControls:

const controls = new OrbitControls(camera, renderer.domElement);
controls.addEventListener('change', () => {
    tick();
});

function tick() {
    renderer.render(scene, camera);
}
tick();

This correctly triggers re-renders during user interaction.

❌ Broken behavior with TrackballControls:

const controls = new TrackballControls(camera, renderer.domElement);

controls.addEventListener('change', (e) => {
    console.log('change', e);
    tick();
});

controls.addEventListener('start', (e) => {
    console.log('start', e);
});

controls.addEventListener('end', (e) => {
    console.log('end', e);  
});

function tick() {
    renderer.render(scene, camera);
}
tick();

Steps:

  1. Scroll the mouse wheel to zoom.
  2. Console shows start, end but no change.
  3. Camera visually moves, but tick() is not triggered.
    Expected: start, change, end.

Live example

null

Screenshots

null

Version

r175

Device

Desktop

Browser

Chrome

OS

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions