Skip to content

Zoom malfunction and model shaking when using setOrbitPoint #599

@leffcha

Description

@leffcha

Describe the bug

When applying controls.setOrbitPoint, the model shakes heavily during rotation. After finishing the rotation with setOrbitPoint, zoom starts behaving unpredictably and the model is easily lost in space.
Could you advise whether this is a bug or if it can be configured to work properly?

setOrbitPoint.mp4
Image Image Image

To Reproduce

Steps to reproduce the behavior:

Use the example “click to set orbit point”.

  1. Add these lines — with them the shaking is clearly visible. Also, for my 3D CAD editor I want to use 0 values for these parameters.

    cameraControls.dollyToCursor = true;
    cameraControls.smoothTime = 0;
    cameraControls.draggingSmoothTime = 0;

  2. Right now you can only notice the shaking. dollyToCursor works well after using setOrbitPoint, but that’s because a PerspectiveCamera is being used. In my project I use an OrthographicCamera.

  3. Switch to OrthographicCamera:

    const camera = new THREE.OrthographicCamera( width / -200, width / 200, height / 200, height / -200, 1, 1000);

  4. Disable CameraControls.ACTION.OFFSET. If you use this, then dollyToCursor doesn’t work with OrthographicCamera.

  5. If you rotate the model, the shaking is visible and dollyToCursor stops working as it should.

using-setOrbitPoint-2.mp4

Code

Live example

No response

Expected behavior

Smooth rotation and normal (expected) zoom behavior after rotation.

Screenshots or Video

No response

Device

No response

OS

No response

Browser

No response

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