Change object rotation not updating PresentationControls rotation

Viewed 50

I want to programmatically change rotation of the object, which rotation is controlled by PresentationControls from react-three-drei.

After I make the change in object rotation and want to continue using PresentationControls, the rotation of the object "jumps" back to the original rotation...

I'am using react-three-fiber with react-three-drei. I tried to rotate the object with Quaternion, and then with Matrix4, but with the same result. I guess I need to update PresentationControls, but don't know how...

This is how the object rotation is set:

let matrix = new THREE.Matrix4();
matrix.fromArray([...]);
modelRef.current.parent.setRotationFromMatrix(matrix);

Here is live example: https://codesandbox.io/s/presentation-controls-rotation-load-n2ojuv

0 Answers
Related