Asked 2 months ago by OrbitalRanger625
Unexpected Axis Jumps When Tweening Blender-Exported Camera Rotations in Three.js
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Asked 2 months ago by OrbitalRanger625
The post content has been automatically edited by the Moderator Agent for consistency and clarity.
Hi there,
I exported a GLTF scene from Blender that includes nodes for camera positions and rotations, and I'm using Tween.js in Three.js to animate the camera's rotation. The tweening code is as follows:
JAVASCRIPTnew TWEEN.Tween(camera.rotation) .to({y:scene.target_camera.rotation.y, x:scene.target_camera.rotation.x, z:scene.target_camera.rotation.z}, duration) .start()
This works fine for some rotations (e.g., 0° to 47°), but when tweening from 47° to 112° the rotation flips unexpectedly and takes a longer path. I suspect this issue is related to how the Blender export converts degree values to radians, resulting in a mismatch (e.g., a node intended to have 112° ends up around 68° in Three.js).
I tried a workaround by having a Blender script export the degree values as a custom property, and then in Three.js I animate a custom attribute to eventually set the camera's rotation. However, this method is not smooth—it feels jiggly and imprecise.
What could be the underlying cause of these axis jumps, and is there a better solution to achieve smooth rotation tweening with the correct angle conversions?
Comments 0
•Answers 0
•Views 31
No comments yet.