Understanding Quaternion Multiplication for 3D FPS Camera: A Simplified Approach

In summary, the conversation is about the formula for multiplying quaternions and the different ways to look at and understand quaternions. The person asking the questions has a limited mathematical background and is struggling to understand the concept of quaternions. It is recommended that they have a stronger foundation in linear algebra and calculus before attempting to understand quaternions.
  • #1
sarah2529
21
0
I'm trying to look how the formula made on this http://www.gamedev.net/reference/programming/features/quatcam/page2.asp" . I want to know how this formula was derived. I tried to look on Quaternions and Rotation Sequences book but they use sin/cos which is so different on this.

N.w = a.w*b.w - a.x*b.x - a.y*b.y - a.z*b.z
N.x = a.w*b.x + a.x*b.w + a.y*b.z - a.z*b.y
N.y = a.w*b.y - a.x*b.z + a.y*b.w + a.z*b.x
N.z = a.w*b.z + a.x*b.y - a.y*b.x + a.z*b.w

or maybe I'm lost?
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
The quaternions form a number system under which addition and multiplication are each closed and associative. Addition is commutative in the quaternions but multiplication is not. There are many ways to look at quaternions as a whole. One view is that a quaternion comprises four real numbers under which multiplication is defined as in the original post. Another view, Hamilton's view, is that a quaternion comprises a real part and three distinct imaginary parts. Yet another is that a quaternion comprise a scalar real part and a vectorial (three vector) imaginary part: [itex]Q=(q_s, \mathbf q_v)[/itex].

Denoting two quaternions as [itex]Q_1=(q_{1s}, \mathbf q_{1v}), Q_2 = (q_{2s}, \mathbf q_{2v})[/itex] then the quaternion product [itex]Q_1Q_2[/itex] can be written using the vector dot and cross products as

[tex]Q_1Q_2 =
(q_{1s}q_{2s} - \mathbf q_{1v}\cdot\mathbf q_{2v},\;\;
q_{1s}\mathbf q_{2v} + q_{2s}\mathbf q_{1v} +
\mathbf q_{1v}\times\mathbf q_{2v})[/tex]

The book Quaternions and Rotation Sequences primarily focuses on unit quaternions. While the unit quaternions are useful (very useful) for representing rotations and transformation, there is a lot more to the quaternions than just the unit quaternions.
 
  • #3
Read it many times but I still didn't understand some of the things you've said. I just don't get it how it is made.

Anyway, do you know what's the pre-requisite for quaternion topics? Is it Linear Algebra? Because I don't understand most of the topics in the book Quaternions and Rotation Sequences. Maybe I jump ahead so fast.
 
  • #4
sarah2529 said:
Because I don't understand most of the topics in the book Quaternions and Rotation Sequences. Maybe I jump ahead so fast.
What is your mathematical background?

Some more detailed questions:
Do you understand complex numbers?
Do you understand Euler's identity [itex]\exp(i\theta) = \cos \theta + i\sin\theta[/itex]?
How much do you know about real and complex analysis?
How much do you know about linear algebra?
 
  • #5
D H said:
Do you understand complex numbers?
I guess so.

D H said:
Do you understand Euler's identity [itex]\exp(i\theta) = \cos \theta + i\sin\theta[/itex]?
Nope. What's that?

D H said:
How much do you know about real and complex analysis?
Yes, I'm taking Calculus 2 class right now.

D H said:
How much do you know about linear algebra?
So little. But I know how to use row reduced in matrices. Thanks to the opencourseware.

Basing on what you've asked, I really did jump so fast. So what would you recommend to me? I really want to understand those quaternions for my 3D First Person Camera Engine.
 
  • #6
sarah2529 said:
D H said:
Do you understand Euler's identity [itex]\exp(i\theta) = \cos \theta + i\sin\theta[/itex]?
Nope. What's that?
That response means you do not really understand complex numbers.

sarah2529 said:
D H said:
How much do you know about real and complex analysis?
Yes, I'm taking Calculus 2 class right now.
Whoa, Sarah!

Here's a sequence in an undergrad math curriculum: Calculus I & II, Ordinary differential equations, Multivariable calculus, Introduction to analysis, Linear algebra, Real analysis, Complex analysis, Calculus of variations, Differential geometry, Abstract algebra (I, II, & III !), General topology, Geometric topology, Algebraic topology, ...

You'll run across the quaternions in the second or third abstract algebra class. You'll find out why they are useful for representing rotations when you take algebraic topology. Trying to understand quaternions when you have not yet finished Calc 2 is jumping the gun. Without the requisite intermediate knowledge all you will have will be a bunch of formulae that just don't make much sense.

As a test, see how much sense you can make of this Wikipedia article: http://en.wikipedia.org/wiki/Charts_on_SO(3)

This article is not quite so esoteric: http://en.wikipedia.org/wiki/Rotation_representation_(mathematics)If you insist on jumping the gun, I suggest checking out a text on abstract algebra or modern algebra. Mine gets to the quaternions on page 503.
 
Last edited:
  • #7
OMG. I'm jumping so far. Do I really need to take "Introduction to analysis->...->Differential geometry" for me to understand Abstract algebra very much? Well I hope I can do that by myself because my curriculum only has until Multivariable calculus (I'm studying Multivariable calculus some time. Vectors... Matrices.. 18.02 in MIT opencourseware helps me so much.).

Curriculum here sucks so bad. I'm doom! I'm 18 and I barely know Multivariate calculus. Am I a failure? lol

Honestly, I really thought Calculus 2 is enough to learn quaternions. I guess I need to finish the lecture notes I found for multivariate so I can move to the next math.

Btw, thanks for the help. Now I realized that my knowledge in math is not enough for my target thesis project.
 
Last edited:
  • #8
No sarah! I have no idea what all those other people are saying: They are saying sth like" You need to understand how natural numbers are defined to use them". Of course this is nonsens- needing abstract algebra for understanding Quaternions!? No way.

I know that book u are talking about is accessible,- it doesn't " even" talk about groups, however, this doesn't mean you are at the appropriate level. If you know Linear algebra(!) and calculus well, you won't have any problems.

To come to your opening post:
How you multiply quaternions is explained on several pages on the internet,- the one you mention uses the "most simplified" fprm, -working out the dot/cross product. I guess you are familiar with dot/cross products.?
 

1. What is a quaternion and how is it used in a 3D FPS camera?

A quaternion is a mathematical concept that represents a rotation in 3D space. In a 3D FPS camera, quaternions are used to store and manipulate the camera's orientation and rotation, allowing for smooth and accurate movement in all directions.

2. How is a quaternion different from other rotation representations, such as Euler angles?

Unlike Euler angles, which can suffer from gimbal lock, quaternions are not subject to this issue and provide a more stable and accurate representation of rotation in 3D space. Additionally, quaternions can be easily converted to and from other rotation representations, making them a versatile tool for 3D graphics.

3. Can quaternions be used for both first-person and third-person cameras?

Yes, quaternions can be used for both first-person and third-person cameras. They are not limited to a specific type of camera and can be applied to any 3D object in a scene.

4. How are quaternions calculated and manipulated in a 3D FPS camera?

Quaternions are typically calculated and manipulated using complex algebraic equations. In a 3D FPS camera, these calculations are often handled by the game engine or graphics library being used. Developers can also use specialized libraries or functions to handle quaternion operations.

5. Are there any disadvantages to using quaternions for a 3D FPS camera?

One potential disadvantage of using quaternions for a 3D FPS camera is that they can be more complex and difficult to understand compared to other rotation representations. Additionally, their calculation and manipulation can be more computationally intensive, which may impact performance in some cases.

Similar threads

  • High Energy, Nuclear, Particle Physics
Replies
1
Views
1K
Back
Top