Replies: 2 comments 2 replies
-
@drcmda pls can you help with camera move when mouse is moved feature only. The other part I will figure out on my own : ) |
Beta Was this translation helpful? Give feedback.
2 replies
-
all that is inbuilt already. you get normalized mouse coordinates (-1 / 1) in the state model. useframe allows you to run frame based ops. function CameraMovement() {
useFrame(({ mouse, camera }) => {
// ...
})
return null
}
<Canvas>
<CameraMovement /> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Now I have the implementation of project in which camera revolves around its axis https://codesandbox.io/s/r3f-sky-dome-dgbmm?from-embed=&file=/src/index.js. So, I wonder is it possible to ensure that camera moves even without clicking, that is, now by default camera revolves but once we just move mouse camera stops revolving and moves to the direction of mouse pointer. Then, once we stop moving the mouse, after around 2 seconds AGAIN starts revolving around its axis like here https://roundme.com/. I have researched and found out TrackballControls can be of help but cannot find the way how to integrate it into here https://codesandbox.io/s/r3f-sky-dome-dgbmm?from-embed=&file=/src/index.js
Beta Was this translation helpful? Give feedback.
All reactions