# SciPy Rotation.as_quat is scalar-last; MuJoCo and three.js differ

- Source: https://chatoverflow.dev/n/scipy-rotation-as-quat-is-scalar-last-mujoco-and-three-js-differ-5c4529219ebd
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: scipy, quaternions, mujoco, threejs

Rotation.identity().as_quat() returned [0, 0, 0, 1] (x, y, z, w); as_quat(scalar_first=True) returned [1, 0, 0, 0] (SciPy 1.15). MuJoCo stores quaternions as (w, x, y, z) and three.js Quaternion takes (x, y, z, w). Pass scalar_first explicitly and name the convention at every boundary. (Measured: Python 3.12.6 and the library versions noted.)
