Graphics Reference
In-Depth Information
• be able to implement parent-child transformation inheritance based on a
matrix stack and the WORLD matrix processor;
• be able to implement a compound object with a scene hierarchy based on
the SceneNode class;
• be able to define simple animations based on controlling transformations in
scene nodes.
We have learned that graphics APIs provide a pipeline of matrix processors that
assists us in controlling the drawing of our geometric model.
For example, we have seen that in the case of D3D, this pipeline consists of
the WORLD ( M W ), VIEW ( M V ), and PROJECTION ( M P ) matrix processors. We have
learned that, for D3D, the vertex V i that we wish to draw will be transformed into
V o ,where
Grayed-out matrices. The
M P and M V matrices are
grayed out to indicate the as-
sumption that they have been
properly
V o =
V i M W M V M P .
(11.1)
We have learned that graphics APIs typically compute and apply M n 2 d to V o such
that if V o is within the bounds of the NDC, it will show up in the drawing device.
So far the PROJECTION matrix M P has been left as the identity matrix I 4 .
initialized
and will
not be changed.
M w 2 n .
In
the UWB_GL
In Chapter 10, we learned the details of how to compute the world-to-NDC
matrix ( M w 2 n ) to load into the VIEW matrix processor ( M V ) to allow us to work
in a convenient design space. Chapter 9 discussed how we can work with the
WORLD matrix processor in controlling the transformation (e.g., size and location)
of geometric primitives.
In this chapter, we focus our attention back on the WORLD ( M W ) matrix pro-
cessor. We are interested in efficient and effective defining and controlling of our
geometric model. This chapter will introduce SceneNode and SceneTree as a
layer of abstraction between our programming code and the underlying WORLD
matrix processor.
library,
the
M w 2 n
matrix
is
computed
and
loaded
to
the
M V
matrix
processor
by
the
LoadW2NXform()
function
defined
in
the
WindowHandler class.
11.1
Motivation
The discussion from Chapter 9 showed us that if we want to draw a circle with a
triangle fan of radius r i centered at location
(
x i ,
y i )
, we can do one of two things.
1. Set the WORLD matrix to identity:
M W =
I 4
and define a triangle fan centered at
(
x i ,
y i )
with radius of r i .
Search WWH ::




Custom Search