Skip to content
Discussion options

You must be logged in to vote

ok i did it already if someone wonder how, here is how

const { viewport } = useThree()
const droneRef = useRef()
useFrame(({ mouse }) => {
const x = (mouse.x * viewport.width) / 12
const y = (mouse.y * viewport.height) / 8
droneRef.current.rotation.set(x, y, 0)
droneRef.current.rotation.set(y, x, 0)
})

and attach ref to my gltf object

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Achi00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant