What is w cordinate in quaternion? How it affect rotation and how to calculate this cordinate?
A quaternion describes a rotation using four complex numbers. You almost never manipulate the numbers individually and they don’t really make any sense on their own.
Here’s an often referred GDC presentation that presents the concept:
If you need to create a quaternion there’s several functions in vmath that will help you.
In the case of quaternions, I think it stands for “wizardry”.
The name starts with a “Q” so I’m going with “quantum mechanics”. So basically what you just said.
As @brtizl mentions, these numbers should rarely be used directly.
However, for a 3D rotation, the xyz is the axis (not normalized!), and the w is the (encoded) angle.
I stumbled upon this old post by change. A (unit) quaternion describes a rotation in space using four REAL numbers; and not four complex numbers.