Graphics Reference
In-Depth Information
1
V
Quaternions Revisited
Peter Sikachev, Vladimir Egorov,
and Sergey Makeev
1.1 Introduction
Quaternions have been extensively used in computer graphics in the last few
years. One defines a quaternion as a hypercomplex number, w + xi + yj + kz ,
but in practice it is convenient to consider it to be a 4D vector ( x, y, z, w ) with
a special operation of multiplication defined for it. In 3D computer graphics,
quaternions can be used to encode rotations and coordinate systems.
In this chapter we describe the experience of using quaternions in the MMO-
RPG engine. In comparison with [Malyshau 12], we propose a quaternion in-
terpolation solution that does not increase vertex count. Besides, we go deeper
in detail regarding precision and performance issues. Finally, we strive to cover
a broader range of problems, including normal mapping, skinning, instancing,
morph targets, and nonuniform scale.
1.2 Quaternion Properties Overview
While strict wording may be found in the excellent book [Lengyel 11], we will
summarize some key quaternion properties below. The quaternion q is called
normalized if
= x 2 + y 2 + z 2 + w 2 = 1. The geometric meaning of a
normalized quaternion ( x, y, z, w ) can be easily perceived if we re-write it as
( x, y, z, w )= x sin α
2
q
,y sin α
2
,z sin α
2
, cos α
2
.
This quaternion encodes an α radians rotation around the axis (normalized vec-
tor) ( x ,y ,z ). This notation immediately provides us with the following prop-
erties for quaternions:
 
 
Search WWH ::




Custom Search