Skip to content

Ability to disable camera interpolation when changing camera orbital position #454

Closed

Description

@cdata

As of #452 users can configure the current camera orbital position with an attribute. By default (and partially as a consequence of how camera control works generally), when the position is configured to a new value, the camera interpolates to the new position (only on subsequent changes, not for the initial value).

This is a sound default, but we should also offer a way for users to opt out of this interpolation if they wish.

Activity

  1. elalish commented on May 3, 2019

    @elalish
    Contributor

    As part of #526, I added a jumpToTarget() method on SmoothControls for this purpose internally. Perhaps we can use that.

  2. elalish commented on May 7, 2019

    @elalish
    Contributor

    It's now called jumpCamera(), and it's a public method, so I'm tempted to close this as fixed when we merge #526.

  3. self-assigned this
    on May 7, 2019
  4. cdata commented on May 7, 2019

    @cdata
    ContributorAuthor

    This is a feature issue so unless it's user-facing we should not close it.

  5. added this to the v0.4.0 milestone on Jun 6, 2019
  6. sam-hajj commented on Apr 9, 2022

    @sam-hajj

    3 years on, when using the example provided in docs (see below), and allowing camera-controls, the interpolation is still forced on the user even while changing positions, this yanks the user's view. Maybe I misunderstood how to use the method?

    image


    I was able to fix the example code like so:

    (() => {
          const modelViewer = this.threeD_model.nativeElement;
          const orbitCycle = [
            '45deg 55deg 4m',
            '-60deg 110deg 2m',
            modelViewer.cameraOrbit
          ];
    
          setInterval(() => {
            // define a var or method to check if your model has a mouse-down event
            if (!this.is_3d_model_clicked) {
              const currentOrbitIndex = orbitCycle.indexOf(modelViewer.cameraOrbit);
              modelViewer.cameraOrbit = orbitCycle[(currentOrbitIndex + 1) % orbitCycle.length];
            }
          }, 3000);
        })();
    

    In Angular2, the framework makes it very easy to set a check to see if the 3D model is being viewed, like so:

    <model-viewer (mousedown)="is_3d_model_clicked = true" (mouseup)="is_3d_model_clicked = false"
    

    However this is just a messy quick fix

  7. elalish commented on Apr 11, 2022

    @elalish
    Contributor

    I can't figure out what you're trying to achieve. What is "the method"? Can you show what the desired behavior is and what behavior you're getting instead? Also, please open a new discussion, since closed issues are not very visible.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions