Giter Site home page Giter Site logo

Comments (5)

yomotsu avatar yomotsu commented on May 27, 2024

As long as you use the cameraControls method, I don't think the "fighting" will happen, because each method will overwrite the final destination.
Would you mind providing a simplified live demo using jsFiddle or similar?

from camera-controls.

Feel2X avatar Feel2X commented on May 27, 2024

Thanks for the quick response!

Unfortunately I can't share any demo or code since I'm not allowed to share, but I'm using await cameraControlsRef.current?.moveTo(targetPosition.x, targetPosition.z, 0, true); in an async function transitionToPoi(poi) in order to move the camera. Each time the selected poi changes (which is handled in react state), this transitionToPoi(poi) function is invoked.

This then results then in the camera e.g. alternating to go slightly towards the first target, then back towards the second target and when it has reached the second target it goes back to the first target.

from camera-controls.

Feel2X avatar Feel2X commented on May 27, 2024

I'm sorry, I just realized that the issue lies in my code and transitions are actually cancelled as they should. I was just calling the transitions in a while loop as long as the offset to the target position is above a certain threshold.

This is a workaround for another issue which I'm facing when using setBoundary together with transitions that should zoom and move at the same time. Here, the move transition stops very early since at the current zoom level the border is already reached while the zoom transition continues until target zoom is reached (where theoretically the move transition could have continued).

Is there a functionality which handles both move and zoom in one function until both target values are achieved?

from camera-controls.

yomotsu avatar yomotsu commented on May 27, 2024

you can call multiple methods at the same time to combine the camera movement.

from camera-controls.

Feel2X avatar Feel2X commented on May 27, 2024

That's what I'm doing yeah, but sometimes the moveTo function doesn't reach the optimum position for the target zoom which is why I'm using the workaround described above. But thank you, I think this works well now

from camera-controls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.