1 year ago

#291579

test-img

tlockhart

How to dynamically update the rotation of a cube with react-three/fiber?

I am attempting to set the rotation of a cube, on click, with react-three/fiber. I would like to be able to click the box and have it rotate from its current angle to a new angle of rotation, each time the cube is clicked. Currently, I have a react-three/fiber codesandbox, however, the animation does not stop at the right angle, and will not restart. I am assuming this is because the clock.elapsedTime continues to run, even while the animation pauses. Can anyone provide any assistance?

reactjs

react-three-fiber

react-spring

0 Answers

Your Answer

Accepted video resources