By codymanix


2019-01-08 10:15:26 8 Comments

I am having trouble understanding the semantics of some members of the XNA/Monogame Quaternion class. The docs are not helpful, and tutorials trying to explain quaternions are using heavy math, which isn't helpful for me either, since I simply do not have proper background for that.

My main questions currently are:

  • Is there any difference between Multiply and Concatenate?

  • What is the exact difference between Inverse and Negate?

1 comments

@Bálint 2019-01-08 13:34:56

There's minimal difference between concatenate and multiply, concatenate(a, b) = b * a

Inverse and negate are different. Negate flips the signs, inverse returns \$q^{-1}\$ so that \$q * q^{-1} = identity = (1, 0, 0, 0)\$, the inverse of the quaternion \$(a, b, c, d)\$ is \$\frac{a -ib-jc-kd}{a^2+b^2+c^2+d^2}\$

@DMGregory 2019-01-08 14:48:59

I'd expect Inverse({1/√2, 0, 0 1/√2}) to yield {-1/√2, 0, 0 1/√2} while Negate would yield {-1/√2, 0, 0 -1/√2}. These two rotations yield the same orientation, but the latter reaches it the long way rather than via the shortest angle.

@codymanix 2019-01-08 15:37:03

What is the semantic of normalizing a Quaternion, I understand that the components will divided by the length, but what happens to the rotation then?

@Bálint 2019-01-08 15:50:29

@codymanix Nothing, but multiplying other quaternions with a normalized one won't change their length. This won't be guaranteed for a non-normalized one

@Bálint 2019-01-08 15:54:56

@DMGregory Fixed

@codymanix 2019-01-09 13:25:47

Does normalizing a Quaternion mean similar as make for example n*2*PI to 0.0 degrees in Euler angles? If this hasn't any drawbacks and does't affect rotation, is it recommended to normalize a Quaternion before persisting it (e.g. store into database)?

@Bálint 2019-01-09 14:48:20

@codymanix quaternions are 4d numbers, so basically a more complicated vector. Multiplying two quaternions results in one with a length equal to the factor of the first two. Since gamedevs generally use floats and those are more precise when they're smaller, it's advised to either normalize quaternions or only use unit length ones when multiplying

Related Questions

Sponsored Content

1 Answered Questions

[SOLVED] Monogame/XNA Hardware Instancing problem

0 Answered Questions

How to apply blur effect to 2D textures using shaders?

  • 2017-04-02 10:13:44
  • user1306322
  • 617 View
  • 0 Score
  • 0 Answer
  • Tags:   shaders monogame

0 Answered Questions

1 Answered Questions

[SOLVED] Additional dependencies in XNA/Monogame

2 Answered Questions

[SOLVED] XNA/MonoGame creating a player

0 Answered Questions

How to get correct quaternion value from real world to screen?

1 Answered Questions

[SOLVED] [ C# ]xna to monogame

  • 2014-04-26 17:55:55
  • Mr.CodeIt
  • 216 View
  • 1 Score
  • 1 Answer
  • Tags:   xna java monogame

3 Answered Questions

[SOLVED] MonoGame performance better then XNA?

1 Answered Questions

[SOLVED] How do 2D art assets (eg. sprites) work?

1 Answered Questions

[SOLVED] Quaternions and rotation around world axis

  • 2011-08-20 08:08:51
  • Kaj
  • 5065 View
  • 11 Score
  • 1 Answer
  • Tags:   quaternion

Sponsored Content