Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Quaternion.identity, what does "identity" mean?

Discussion in 'General Discussion' started by bibbis, May 20, 2020.

  1. bibbis

    bibbis

    Joined:
    Dec 5, 2016
    Posts:
    58
    I know what Quaternion.identity does, but I don't understand what "identity" means in this context.
    I've been wondering about this for several years now.
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,951
    Benawtopia likes this.
  3. bibbis

    bibbis

    Joined:
    Dec 5, 2016
    Posts:
    58
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,951
  5. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
    "No transformation" Queternion. Same logic as identity matrix. In case of Quaternion it is 0, 0, 0, 1
     
    laurajhchen likes this.
  6. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    ? I would expect
    1 0 0 0
    0 1 0 0
    0 0 1 0
    0 0 0 1

    ...for an identity matrix. Why is it only one row?
     
  7. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,553
    Because it is a quaternion, not a matrix, and quaternion only has 4 components in it. (X, Y, Z, W in games, although in math papers it can be abcd, ijkr, and so on).

    Identity transform - for a quaternion - is X=0, Y=0, Z=0, W=1.

    When storing rotations, XYZ components store rotation axis scaled by factor of Sin(rotAngle/2), and W stores Cos(rotAngle/2). Because 0 degree angle has Cos==1, and Sin==0, we get 0, 0, 0, 1