Comments (5)
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.
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.
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.
you can call multiple methods at the same time to combine the camera movement.
from camera-controls.
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)
- Speed up setLookAt or lerpLookAt HOT 5
- Invalid "main" entry in v2.8.x HOT 10
- Add focus function HOT 7
- Error 'ThreeCameraControls.install is not a function' HOT 2
- Mouse wheel zoom doesn't work with pressed Shift on Mac HOT 1
- The automated release is failing 🚨 HOT 1
- Update three.js version to 162 HOT 2
- Not update in worker HOT 5
- Dolly to Cursor and focalOffset HOT 5
- I want to replace camera-controls with the default controls in my project, here is an example, how can I do it to be compatible correctly? HOT 2
- fitToBox on a plane: how to prevent plane to get perpendicular to view? HOT 1
- Dolly to cursor reaches limit HOT 4
- Dolly to cursor does not maintain steady speed
- Roll/tilt control HOT 1
- Can't zoom after switching between cameras HOT 10
- Cannot dispatch custom event HOT 4
- It would be nice to have setFov method with smooth transition
- Transition updateCameraUp HOT 1
- Control functions skip frames when frameloop = demand HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from camera-controls.