Advanced Game Engineering RealTime Rendering - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

Advanced Game Engineering RealTime Rendering

Description:

Illustration of the rotation transform represented. by a unit quaternion, ... slerp could be used in a straightforward fashion. ... – PowerPoint PPT presentation

Number of Views:87
Avg rating:3.0/5.0
Slides: 31
Provided by: eclInc
Category:

less

Transcript and Presenter's Notes

Title: Advanced Game Engineering RealTime Rendering


1
Advanced Game EngineeringReal-Time Rendering
Transforms
  • ? ?
  • 2006/03/22
  • Dept. of CSE, Univ. of Incheon
  • pucktan_at_incheon.ac.kr

2
Contents
  • Transforms
  • Basic Transforms
  • Special Matrix Transforms and Operations
  • Quaternions
  • Vertex Blending
  • Projection

3
Quaternions
  • ? ?
  • Quaternions wer invented back in 1843 by Sir
    William Rowan Hamilton.
  • An extension to the complex numbers
  • A powerful tool for constructing transforms
  • They are superior to both Euler angles and
    matrices.
  • Especially when it comes to rotations and
    orientations.
  • ex) Quaternions are represented very
    compactly. Thay can be used for the stable
    interpolation of orientations
  • A quaternion has four components.
  • Expression

4
Quaternions
  • Mathematical Background
  • Definition of Quaternions
  • variable is called the real part of a
    quaternion,
  • Imaginary part is , and and
    called imaginary units.
  • For the imaginary part, , we can use all the
    normal vector operations,such as addition,
    scaling, dot product, cross product, and more.

A quaternion can be defined in the following
ways, all equivalent.
(3.28)
5
Quaternions
  • The multiplication operation between two
    quaternions, and , is derived as shown
    below.
  • The multiplication of the imaginary units is
    noncommutative.

Multiplication
(3.29)
6
Quaternions
  • The definitions of addition, conjugate, norm, and
    an identity
  • When is simplified, the
    imaginary parts cancel out and only a real part
    remains.
  • Expression of Norm

Addition Conjugate Norm Identity
(3.30)
7
Quaternions
  • We derive a formula from Definition of the Norm
  • Multiplicative inverse

(3.31)
(3.32)
(3.33)
?
(3.34)
8
Quaternions
  • The formula for the inverse uses scalar
    multiplication
  • ? (3.29) ?? ??? ?????? ??!!


  • , which means that scalar multiplication is
    commutative
  • ?

Conjugate rules Norm rules Laws of
Multiplication Linearity Associativity
(3.35)
(3.36)
(3.37)
9
Quaternions
  • A unit quaternion, is such
    that .
  • For complex numbers, a two-dimensional unit
    vector
  • The equivalent for quaternions is

(3.38)

(3.40)
10
Quaternions
  • Quaternion Transforms
  • Unit quaternions is that they can represent any
    three-dimensional rotation
  • Unit quaternions is that this representation is
    extremely compact and simple
  • Example, put the four coordinates of a point or
    vectorinto the components of a quaternion ,
    and assume that we have a unit quaternion
    . Then
  • rotates around the axis by an
    angle


(3.42)
11
Quaternions
  • This rotation, which clearly can be used to
    rotate around any axis.

12
Quaternions
  • Negating the axis, , and the real part, ,
    creates a quaternion which rotates exactly as the
    original quaternion does.
  • Given two unit quaternions, and , the
    concatenation of first applying and then
    to a quaternion, ,is given by Equation
  • is the unit quaternion representing
    the concatenation of the unit quaternions and


(3.43)
13
Quaternions
  • Matrix Conversion
  • Some systems have matrix multiplication
    implemented in hardware.
  • A quaternion, , can be converted into a
    matrix , as expressed in Equation

14
Quaternions
  • Ths scalar is .
  • Once the quaternion is constructed, no
    trigonometric functions need to be computed, so
    the conversion porcess is efficient in practice.

15
Quaternions
  • The reverse conversion, from an orthogonal
    matrix.
  • Differences made from matrix in Equation
  • The trace, tr(M), of a matrix, M, is simply the
    sum of the diagonal elements of the matrix.


(3.46)

(3.47)
16
Quaternions
  • This result yields the following conversion for a
    unit quaternion
  • To have a numerically stable routine. Divisions
    by small numbers should be avoided. Set


(3.48)

(3.49)
17
Quaternions
  • Which in turn implies that the largest of
    and u determine which of
    is largest. If is largest..
  • Used to compute the largest of
  • Equation (3.46) is used to calculate the
    remaining components of


(3.50)
18
Quaternions
  • Spherical Linear Interpolation
  • operation that given two unit quaternions,
    and , and a parameter , computes
    an interpolated quaternion.
  • This is useful for animating object, for example
  • Expression by the composite quaternion, ,
    below
  • For software implementations
  • To compute , which is needed in the equation
    above,, the following fact can be used


(3.51)

(3.52)
19
Quaternions
  • Example
  • The slerp function is perfectly suited for
    interpolating between two orientations.
  • This procedure is not as simple with the Euler
    transform, because when several Euler angles need
    to be interpolated, gimbal lock can occur.

20
Quaternions
  • When more than two orientations, say
    are available, and we want to
    interpolate..? slerp could be used in a
    straightforward fashion.
  • A better way to interpolate is to use some sort
    of spline.
  • Expression of spline
  • The squad function is constructed from repeated
    spherical interpolation using slerp. (ref.
    Section 12.1.1 ??? ?? ?? ????)


(3.53)
21
Quaternions
  • Rotation from One Vector to Another
  • A common opertation is transforming from one
    direction s to another direction t.
  • Normalize s and t
  • Compute the unit rotation axis, called u
  • and
    , where is the angle between s
    and t
  • The quaternion that represents the rotation from
    s to t is then . .


(3.55)
22
Quaternions
  • Stability problems appear for both methods when s
    and t point in opposite directions, as a division
    by zero occurs.
  • ? any axis of rotation perpendicular to s can be
    used to rotate to t

23
Vertex Blending
  • Imagine that an arm of a digital character is
    animated using two parts, a forearm and an upper
    arm.
  • Then the joint between these two parts will not
    resemble a real elbow.? because two separate
    objects are used.

24
Vertex Blending
  • Vertex blending is one possible solution to this
    problem.
  • Several other names have been This technique.
  • Skinning
  • Enveloping
  • Skeleton-subspace deformation
  • The forearm and the upper arm are animated
    separately as before, but at the joint the two
    parts are connected through an elastic skin.
  • ? called stitching

25
Vertex Blending
  • One step further
  • On can allow a single vertex to be transformed by
    several different matrices, with the results
    weighted and blended together.

26
Vertex Blending
  • The entire arm may be elastic, all vertices may
    be affected by more than one matrix, the entire
    mesh is often called a skin.

Figure 3.11. Areal example of vertex blending.
27
Vertex Blending
  • The vertex blending equation is
  • p is the original vertex.
  • u(t) is the transformed vertex whose position
    depends on the time t.
  • is the ith bones world transform that
    changes with time to animate the object.
  • The matrix transforms from the initial
    bones coordinate system to world coordinates.


(3.58)
28
Vertex Blending
  • Vertex blending can be done by the host CPU.
  • If the application is the bottleneck, then it is
    worth doing this operation on the graphics
    hardware, if possible.
  • DirectX 8 skinning method
  • through a choice of either of two pipelines, the
    fixed function path
  • This method supports a 256 matrix palette for
    vertex blending
  • Each vertex can use a maximum of four of these
    matrices.
  • through the vertex shader (Section 6.5)
  • This matrix palette system cannot be used in
    conjunction with the vertex shader, as it is part
    of an entirely different pipeline.

29
Vertex Blending
  • Problem of Vertex blending
  • Unwanted folding, twisting, and self-intersection
    can occur.

Figure 3.12. Problems with vertex blending
30
????
  • REAL-TIME RENDERING SE
  • www.naver.com ??IN
  • http//www.galexandria.com/ ?????? ???
Write a Comment
User Comments (0)
About PowerShow.com