I’m having trouble getting the value from the degree back.
const radians = 135 * (180 / Math.PI);
model.matrix.setPlacementTransform(
new THREE.Matrix4().compose(
new THREE.Vector3(position[0] ?? 0, position[1] ?? 0, position[2] ?? 0),
new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 0, 1), radians);
new THREE.Vector3(1, 1, 1)
)
);
Decompose
let translation = new THREE.Vector3(),
rotation = new THREE.Quaternion(),
scale = new THREE.Vector3();
model.matrix.decompose(translation, rotation, scale);
You can’t convert a quaternion in a single angle value. A quaternion is one way to express orientation in 3D space. Alternatives are rotation matrices, euler angles or the axis-angle approach that you have used in your first code snippet to setup the quaternion.
Your probably have to convert the quaterion back to the axis-angle representation like so: