Computer Graphics Applications of Computer Graphics: Input Devices
Computer Graphics Applications of Computer Graphics: Input Devices
Input Devices
Raster Devices
Vector Devices
•
• Raster graphics cannot draw perfect curved or slopping lines.
• The appearance of curved or sloping lines improves as the size of the pixels decreases.
• Software techniques can also be used to improve the visual appearance of pixel based lines.
Portability
• portability
The ability to be easily accessed or run by different systems and applications.
• Software can be portable at the source code level, or at the object code (executable) level.
• Most non-graphic programs are portable at the source code level, but must be recompiled to
produce executable files for each separate system.
• Most graphics programs are non-portable, even at the source level.
TRANSFORMATIONS
• Transformations are one of the primary vehicles used in computer graphics to manipulate
objects in three-dimensional space. Their development is motivated by the process of
TRANSLATION
Overview
Translation is one of the simplest transformations. A translation moves all points of an object a
fixed distance in a specified direction. It can also be expressed in terms of two frames by
expressing the coordinate system of object in terms of translated frames.
matrix of this type (for arbitrary ) will translate the frame . We call any matrix
That is, we can translate the point within the frame . An illustration of this is shown in the
following figure
Summary
Translation is a simple transformation that is calculated directly from the conversion matrix for
two frames, one a translate of the other. The translation matrix is most frequently applied to all
points of an object in a local coordinate system resulting in an action that moves the object
within this system.
SCALING
Overview
Scaling, like translation is is a simple transformation which just scales the coordinates of an
object. It is specified either by working directly with the local coordinates, or by expressing the
coordinates in terms of Frames
- that is, we just expand (or contract) the lengths of the vectors defining
the frame. It is fairly easy to see that we can write the frame in terms of the frame by
So a matrix implements a scaling transformation on frames, and any matrix of this type
a scaling matrix and utilize matrices of this type to implement our scaling operations.
Applying the Transformation Directly to the Local Coordinates
and we have scaled the point within the frame . An illustration of this is shown in the
following figure
It is difficult to see the origin of the scaling operation when working only with coordinates - so
for example, consider the eight vertices of a cube centered at the origin in the Cartesian frame.
(-1, -1, 1 )
(-1, 1, 1 )
(1, 1, 1 )
(1, -1, 1 )
(-1, -1, -1 )
(-1, 1, -1 )
(1, 1, -1 )
(1, -1, -1 )
If we consider the ``scaling'' transformation given by
and apply this matrix to each of the coordinates of the points relative to the standard frame, we
obtain a new set of points
(-2, -2, 2 )
(-2, 2, 2 )
(2, 2, 2 )
(2, -2, 2 )
(-2, -2, -2 )
(-2, 2, -2 )
(2, 2, -2 )
(2, -2, -2 )
which is an effective scaling of the cube (The resulting cube has volume 8 times the original).
This operation is illustrated in the following figure (Note that this figure is viewing the cube
from along the axis).
We note that this operation scales about the origin of the coordinate system. If the center of the
object is not at the origin, this operation will move the object away from the origin of the frame.
If we consider a cube with the following coordinates at its corners
(1, 1, 1 )
(1, 3, 1 )
(3, 3, 1 )
(3, 1, 1 )
(1, 1, 3 )
(1, 3, 3 )
(3, 3, 3 )
(3, 1, 3 )
Then by applying the above transformation, this cube is transformed to a cube with the following
coordinates
(2, 2, 2 )
(2, 6, 2 )
(6, 6, 2 )
(6, 2, 2 )
(2, 2, 6 )
(2, 6, 6 )
(6, 6, 6 )
(6, 2, 6 )
which is a cube with volume 8 times the original, but centered at the point . This is
illustrated in the following figure.
If the desired scaling point is not at the origin of the frame, we must utilize a combination of
frame, we can utilize the translation to first move the point to the origin of the
frame, then scale the object, and finally use the translation to move the point back to
the origin of the scaling. These transformations are all represented by matrices:
and we take their matrix product to create one matrix that gives the transformation.
Summary
The scaling transformation can be represented by a simple matrix whose only entries are
on the diagonal. This transformation, when applied to an object multiplies each of the local
coordinates of the object by a factor - effectively scaling the object about the origin. Scaling
about other points can be done by combining the scaling transformation with two translation
transformations
ROTATION
Overview
Overview
The 3-dimensional rotation matrix, when rotating about one of the coordinate axes is quite
similar to the rotation matrix developed for rotation in two-dimensions. Here rotation is
much simpler to describe, as rotation is about a point in two-dimensions. Here we develop the
rotation matrix in two-dimensions that rotates a point about the origin in the Cartesian frame.
In Two Dimensions
In two dimensions, one rotates about a point. We will rotate about the origin, and will consider
our 2-d frame to be the two-dimensional Cartesian frame. Consider the following figure
where we depict a rotation of units about the origin and the point is rotated into the
Summary
Rotation about the origin in two-dimensions is given by a simple matrix written in terms
of the cosine and sine of the angle of rotation. This development can be applied directly to
develop the rotation matrices for the three-dimensional rotations about the X, Y and Z axes.
Overview
Rotation about the x-axis is similar to rotation specified in two-dimensional space as in the three-
dimensional rotation, the x-coordinate must remain constant.
The transformation for rotation of radians about the -axis in the Cartesian frame is given by
the matrix
(Note that as a point is rotated about the -axis, the value of the point will not change.) If this
Overview
Rotation about the y-axis is similar to rotation specified in two-dimensional space as in the three-
dimensional rotation, the y coordinate must remain constant.
The transformation for rotation of radians about the -axis is given by the matrix
Overview
Rotation about the z-axis is similar to rotation specified in two-dimensional space as in the three-
dimensional rotation, the z-coordinate must remain constant.
The transformation for rotation of radians about the -axis is given by the matrix
Overview
An axis in space is specified by a point and a vector direction . Suppose that we wish to
rotate an object about this arbitrary axis.
We know how to do this in the cases that the axis is the x axis, the y axis, or the z axis in the
Cartesian frame (these were just generalizations of the two-dimensional rotations), but the
general case is more difficult. In these notes we present a solution to this problem that utilizes
both translation and the above rotation matrices to accomplish this task. (One can also approach
this problem through the use of frame-to-frame-conversion transformations.)
First assume that the axis of rotation can be specified in terms of Cartesian coordinates, i.e. can
,
• Use the elementary rotation transformations to rotate the vector until it coincides with
one of the coordinate axes. To do this, first rotate the vector until it is in the plane by
where
and finally using the translation, to translate back to the original axis.
The matrix representation of the general rotation is given by the product of the above
transformations.
These can be multiplied together (they are all matrices) to give one matrix which
represents the general rotation.
What if the Axis was Specified in a Local Frame?
In this case, we just convert the coordinates of the point and vector defining the axis to
Cartesian coordinates using the frame-to-Cartesian-frame transformation, do the above
operations, and then use the Cartesian-frame-to-frame to convert the resulting coordinates back
to the local system.
Summary
We have developed a simple method using only basic transformations by which general rotation
can be accomplished. It utilizes translation and the basic rotations about the x axis, the y axis,
and the z axis to accomplish this task. This individual matrices specified may be multiplied
Viewing Transformation
Conventional Animation
(Key-frame animation)
The name "Key-Frame Animation" comes from combining the use of key
frames and inbetweening. The name is also applied to computer-based
systems that mimic this process.
Storyboard (outline of the animation)
Detailed layout (drawing for every scene in the animation)
Soundtrack (instants at which significant occur are recorded in order)
Key frames are drawn
Inbetweening
Pencil test
Cels are painted, composition of foreground and background
Assembled cels are ordered and filmed
Splines
(Curves used to approximate a set of control points)
Vt = (1-f(t))Vs + f(t)Ve
Smooth initiation and termination of changes (smooth-in and smooth-
out)
Relatively constant rate of change in between
Example: f'(0) = f'(1) = 0, slope constant in middle of range
Procedural Control
Computation in realtime
Zoom/Pan and double buffering
Color map lookup table (LUT) animation
Computer Graphics?
puter graphics includes almost everything on computers that is not text or sound. Today almost every computer can do some graphics, and
expect to control their computer through icons and pictures rather than just by typing.
ab at the Program of Computer Graphics, we think of computer graphics as drawing pictures on computers, also called rendering
be photographs, drawings, movies, or simulations -- pictures of things which do not yet exist and maybe could never exist. Or th
m places we cannot see directly, such as medical images from inside your body.
uch of our time improving the way computer pictures can simulate real world scenes. We want images on computers to not just l
also to BE more realistic in their colors, the way objects and rooms are lighted, and the way different materials appear. We call t
age synthesis", and the following series of pictures will show some of our techniques in stages from very simple pictures through
.
ndering
aphics uses several simple object rendering techniques to make models appear three-dimensional.
niques extend the realistic appearance of objects and introduce features such as transparency and textures.
ng
d Transparency
y to appreciate how far these simple techniques have been developed is through much more complex (and more recent) Cornell c
ges
y?
s are diffuse, not shiny, and ray tracing does not correctly depict how light reflects from diffuse surfaces. Our laboratory has pla
oping radiosity techniques for more realistic and more physically accurate rendering.
ght
image sampler shows more current work in radiosity and other techniques.
wing Algorithms
drawing is our first adventure into the area of scan conversion. The need for scan conversion, or rasterization, techniques is a dir
nature of raster displays (thus the names).
splays are particularly well suited for the display of lines. All that is needed on a vector display to generate a line is to supply the
oltages to the x and y deflection circuitry, and the electron beam would traverse the line illuminating the desired segment. The on
ies in the lines drawn a vector display resulted from various non-linearities, such as quantization and amplifier saturation, and th
rces in the display circuitry.
ter displays came along the process of drawing lines became more difficult. Luckily, raster display pioneers could benefit from p
e in the area of digital plotter algorithms. A pen-plotter is a hardcopy device used primarily to display engineering line drawings
ike raster displays, are discretely addressable devices, where position of the pen on a plotter is controlled by special motors calle
at are connected to mechanical linkages that translates the motor's rotation into a linear translation. Stepper motors can precisely
f a rotation (for example 2 degrees) when the proper controlling voltages are applied. A typical flat-bed plotter uses two of these
axis and a second for the y-axis, to control the position of a pen over a sheet of paper. A solenoid is used to raise and lower the a
wing and positioning.
m line is that most of the popular line-drawing algorithms used to on computer screens (and laser and ink-jet printers for that ma
developed for use on pen-plotters. Furthermore, most of this work is attributed by a single man, Jack Bresenham, who was an IB
. He is currently a professor at Winthrop University.
ture we will gradually evolve from the basics of algebra to the famous Bresenham line-drawing algorithms (along the same lines
aper by Bob Sproull), and then we will discuss some developments that have happened since then.
isplays
• Oscilloscopes were some of the 1st computer displays
Used by both analog and digital computers
Computation results used to drive the vertical and horizonta
(X-Y)
Intensity could also be controlled (Z-axis)
Used mostly for line drawings
Called vector, calligraphic or affectionately stroker displays