Graphics Reference
In-Depth Information
1 range (NDC) ( Fig-
ure 10.2 ) . This same operator also proportionally transforms the two squares
inside the rectangular area where the transformed squares are proportionally lo-
cated inside the NDC space. This is an example of the linear property of affine
transformation: if the transform operator works for a rectangle, then all geometric
contents inside the rectangle will also transform appropriately. For this reason,
when deriving coordinate transformations, we only need to consider the operator
that transforms the enclosing rectangular region of interest.
(
0
,
0
)
to
(
200
,
160
)
rectangular area to the area within the
±
10.2
Device and Normalized Coordinate Systems
Coordinate system and
space. Coordinate systems
and coordinate spaces are
used interchangeably in this
topic. For example, device
coordinate system and device
coordinate
In Section 3.1 when we wanted to describe vertex positions of the squares, we
borrowed concepts from the Cartesian coordinate system with the horizontal and
vertical axes and units on the axis. From the discussion in the previous section,
we see two examples of applying the concepts associated with the Cartesian co-
ordinate system.
space
are
both
referred to as the DC.
1. Device coordinate (DC). When we draw and refer to positions on the ap-
plication window, implicitly, we assume a coordinate system. We assume
that the origin is located at the lower-left corner of the window, with units
being pixels. Note that the DC is a variable coordinate system, where it can
be changed even during the lifetime of an application (e.g., by resizing the
application window size). The DC has dimension width ( W dc ) by height
( H dc ). The application's drawing area is the DC space.
NDC and OpenGL. For sim-
ilar reasons as discussed here,
the OpenGL API also defines
the NDC as its internal coor-
dinate system. The OpenGL
API also performs the exact
same M n 2 d operator (as de-
fined by Equation (10.6)) on
every input vertices.
2. Normalized (device) coordinate (NDC). With center at the origin and x / y
ranges between
2 square area. This is
the internal coordinate system of the D3D graphics API. We have seen that,
as programmers working with D3D, we are responsible for programming
the matrix processors such that all vertices are transformed into the NDC
(i.e., the M w 2 n operator). In turn, D3D will automatically transform vertices
from NDC to DC when processing the vertices (i.e., the M n 2 d ). The NDC
never changes.
1and
+
1, the NDC defines a 2
×
Although the internal NDC representation causes extra complexity and process-
ing, the NDC representation is also very important for the following reasons.
Consistency and flexibility. A well-defined constant coordinate system is
important for the internal implementation of the D3D API. As programmers
of the API, such a well-known coordinate system provides a fixed reference
Search WWH ::




Custom Search