Graphics Reference
In-Depth Information
Square with
Source Color
S= ( 0.3,0.3,0.3 )
Destination
Pixels ( D )
Application
Window
Render
(Assign S to D )
Figure 12.7.
Rendering a dark gray square.
D, we compute the vectors in WC space. From this point on, the remaining code
is very similar to that of Listing 12.3, where one vector is turned gradually into
another.
Notice that the p w f in Tutorial 12.1 is different from the one computed in this
tutorial. Although in the previous case, p oc f was transformed by Equation (12.1)
based on the arm's OC-to-WC transformation matrix ( M a ), in this tutorial, the
same p oc f position is transformed in Equation (12.2) based on the palm's OC-to-
WC transformation matrix ( M p M a ). In this way, although based on the same
OC space front position ( p o f ), we can obtain two different front positions for
computing the front vectors for arm ( V w f ) and palm ( V w p ).
12.2
Alpha Blending and Transparency
0.0to1.0colorrepresenta-
tion. The following discus-
sion assumes that each chan-
nel of the color is specified
as a normalized floating-point
number where 0 . 0 means off
and 1 . 0 is the maximum.
At this point, from having worked with graphics APIs quite extensively, we un-
derstand that the rendering of a primitive involves assigning appropriate colors to
the corresponding pixels. For example, Figure 12.7 shows a dark gray square be-
ing rendered into appropriate pixels. In this case, the source color of the squares
is S ,
S
=(
S r ,
S g ,
S b )=(
0
.
3
,
0
.
3
,
0
.
3
) .
Those pixels that will be covered by the square are the destination pixels, D ,
D
=(
D r ,
D g ,
D b ) .
Search WWH ::




Custom Search