godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.81k stars 3.13k forks source link

Godot uses JPL style quaternions instead of Hamilton #6271

Closed fire closed 7 months ago

fire commented 1 year ago

Your Godot version: https://github.com/godotengine/godot/commit/0c23a2cfe3ad897e1e49008629c135764b2c155c

Issue description:

Software Quaternion convention
Godot Engine JPL
Blender ?
ISO 8855:2011 ?
Unreal Engine ?
Unity ?
Three.js ?
Eigen ?

Godot uses JPL style quaternions instead of Hamilton. We should add a note somewhere so people don't get frustrated why their math doesn't work.

https://fzheng.me/2017/11/12/quaternion_conventions_en/

https://arxiv.org/abs/1801.07478

This is a report so it doesn't get lost.

The math for conversion from JPL or Hamilton is take x,y,z,w where x,y,z is the axis and multiply the axis by -1. W is the scalar like 1.

URL to the documentation page: Not that familiar.

YuriSizov commented 1 year ago

Where should we add such a note?

fire commented 1 year ago

When I last asked GDQuest our residential uiux person, he said that most people don't read the docs, and that putting it in the tooltips of Quaternion is probably the most usable place. If that doesn't work at least in the help browser xml.

fire commented 1 year ago

aaronfranke — Today at 09:44 iFire I just checked in Blender using its Python scripting https://docs.blender.org/api/current/mathutils.html The Quaternion type follows the rule ij = k and ijk = -1 so it's Hamilton.