Graphics Reference
In-Depth Information
In addition, with respect to hands-on programming, we should:
• be able to comprehend existing graphics API transformation-related pro-
gramming code;
• be able to program and take advantage of the matrix stack facility in reusing
and combining transformation operators.
Transformation operator
vs. transformation matrix.
In the rest of this topic,
we will use transformation
operator and transformation
matrix interchangeably.
As discussed in Section 8.6, the D3D RC pipeline implements
VM W M V M P ,
where the input vertex V is operated on by three separate transformation oper-
ators. In this chapter, we will study what it means to combine transformation
operators and how to strategically combine these operators to accomplish more
complex transformation operations.
9.1
Concatenation of Operators
We observe that both the input and output of the three transformation operators
are vectors (representing vertex positions). For example, the translation operator
T
(
t x
,
t y
)
:
V at =
V a T
(
t x ,
t y ) ,
or
V at =
V a T
,
where both V a and V at are vectors, representing coordinate positions. Because all
operators accept vectors and compute vectors, in general, we can feed the output
of one operator into the input of another operator. For example, we can direct the
output of the above translation as the input of a scaling operator S :
V at s =
V at S
.
In this case, if
V a = x a y a ,
then we know that
V at = t x +
y a
x a t y +
and that
V at s
=
V at S
(
s x ,
s y )
= x a +
t y S
t x y a +
(
s x ,
s y )
(9.1)
= (
y s .
x a +
t x ) ×
x s
(
y a +
t y ) ×
Search WWH ::




Custom Search