Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 6

The Camera Analogy

The transformation process to produce the desired scene for viewing is analogous to taking a photograph
with a camera. As shown in Figure 3-1, the steps with a camera (or a computer) might be the following:
1. Set up your tripod and point the camera at the scene (viewing transformation).
2. Arrange the scene to be photographed into the desired composition (modelling transformation).
3. Choose a camera lens or adjust the zoom (projection transformation). Determine how large you want
the final photograph to be for example, you might want it enlarged (viewport transformation).
4. After these steps are performed, the picture can be snapped or the scene can be drawn.

Note that these steps correspond to the order in which you specify the desired transformations in your
program, not necessarily the order in which the relevant mathematical operations are performed on an
object's vertices. The viewing transformations must precede the modelling transformations in your code,
but you can specify the projection and viewport transformations at any point before drawing occurs. Figure
3-2 shows the order in which these operations occur on your computer.

To specify viewing, modelling, and projection transformations, you construct a 4 4 matrix M, which is
then multiplied by the coordinates of each vertex v in the scene to accomplish the transformation

v'= Mv
(Remember that vertices always have four coordinates (x, y, z, w), though in most cases w is 1 and for
two-dimensional data z is 0.) Note that viewing and modelling transformations are automatically applied to
surface normal vectors, in addition to vertices. (Normal vectors are used only in eye coordinates.) This
ensures that the normal vector's relationship to the vertex data is properly preserved.
The viewing and modelling transformations you specify are combined to form the model view matrix,
which is applied to the incoming object coordinates to yield eye coordinates. Next, if you have specified
additional clipping planes to remove certain objects from the scene or to provide cutaway views of objects,
these clipping planes are applied.
After that, OpenGL applies the projection matrix to yield clip coordinates. This transformation defines a
viewing volume; objects outside this volume are clipped so that they are not drawn in the final scene. After
this point, the perspective division is performed by dividing coordinate values by w, to produce
normalized device coordinates.
Finally, the transformed coordinates are converted to window coordinates by applying the viewport
transformation. You can manipulate the dimensions of the viewport to cause the final image to be
enlarged, shrunk, or stretched.
You might correctly suppose that the x and y coordinates are sufficient to determine which pixels need to
be drawn on the screen. However, all the transformations are performed on the z coordinates as well. This
way, at the end of this transformation process, the z values correctly reflect the depth of a given vertex
(measured in the distance away from the screen). One use for this depth value is to eliminate
unnecessary drawing. For example, suppose two vertices have the same x and y values but different z
values. OpenGL can use this information to determine which surfaces are obscured by other surfaces and
can then avoid drawing the hidden surfaces. This technique is called hidden-surface removal.
As you have probably guessed by now, you need to know a few things about matrix mathematics to get
the most out of this text. If you want to brush up on your knowledge in this area, you might consult a
textbook on linear algebra.

A. Vocabulary.
1.

Find the following words in the dictionary. Translate them into


Czech. Be prepared to explain their meaning in English.
snap

cutaway

to stretch

to yield

to enlarge

to obscure

to clip

to shrink

to avoid

2.
tripod

Match the words with their meaning.


usually a piece of glass, curved on one or both sides makes a beam of light
bend, spread out, narrow, change direction

to accomplish

to accommodate, adapt, regulate, change

to preserve

to achieve, complete successfully

to adjust

to keep unchanged, save, sustain

plane

a completely flat surface

lens

three-legged support

3.

Complete the text using the correct form of the given words where
appropriate.
application,
graphics

to consist of,

to include,

OpenGL is a software interface to

(1)

to implement,

platform,

to achieve,

_____________ hardware. This interface

(2)

to perform,

_____________

about 150 distinct commands that you use to specify the objects and operations needed to produce
interactive three-dimensional
independent interface to be

(3)

(4)

_____________ . OpenGL is designed as a streamlined, hardware-

_____________ on many different hardware

_____________ these qualities, no commands for


user input are

(8)

(7)

(5)

_____________ .

(6)

_____________ windowing tasks or obtaining

_____________ in OpenGL; instead, you must work through whatever windowing

system controls the particular hardware you are using.


4.

Complete the text given below with appropriate words which should
be guessed according to their descriptions.
1. to happen (esp. unplanned events), to take place
2. the group of numbers or symbols arranged in a rectangle which can be used together as a
single unit to solve particular mathematical problems
3. the point where two lines meet to form an angle
4. to finish st. successfully or to achieve st.
5. to use
6. to make certain to happen
7. to keep up

Note that these steps correspond to the order in which you specify the desired transformations in your
program, not necessarily the order in which the relevant mathematical operations are performed on an
object's vertices. The viewing transformations must precede the modeling transformations in your code,
but you can specify the projection and viewport transformations at any point before drawing occurs. Figure
3-2 shows the order in which these operations occur on your computer. To specify viewing, modeling, and
projection transformations, you construct a 4 4 matrix M, which is then multiplied by the coordinates of
each vertex v in the scene to accomplish the transformation.

(Remember that vertices always have four coordinates (x, y, z, w), though in most cases w is 1 and for
two-dimensional data z is 0.) Note that viewing and modeling transformations are automatically applied to
surface normal vectors, in addition to vertices. (Normal vectors are used only in eye coordinates.) This
ensures that the normal vector's relationship to the vertex data is properly preserved.
B. Text comprehension.
1.
1.

2.

Decide whether the following statements are true or false.


The viewing transformations must succeed the modelling transformations in your code.

2.

If you have specified additional clipping planes to add certain objects from the scene or to provide
cutaway views of objects, these clipping planes are applied.

3.

The clip coordinates projection matrix transformation defines a viewing volume; objects outside
this volume are clipped so that they are not drawn in the final scene.

4.

You can manipulate the dimensions of the viewport to cause the initial image to be enlarged,
shrunk, or stretched.
Answer the questions.
1. What are the steps of the transformation process to create a desired scene?
2. Why are the viewing and modelling transformations combined?
3. What kind of transformation is applied to get window coordinates?

3.

Explain what the technique called hidden-surface removal is?

4.

Find synonyms.
zoom
picture
to specify
to eliminate
volume
depth
to convert
to apply

5.

Find antonyms (opposites).


desired
large
relevant
precede
to remember
properly
incoming
finally

6. Form a new part of speech from the word given.


Noun

Verb

Adjective
analytic

transformation
to relate
projection
to enlarge
additional
composition
to construct
C. Grammar.
Latin-Greek Plurals
Latin and Greek have influenced the English language in many ways, especially in terms of the scientific
language. Most educated people know how to use the following terms, but do not necessarily know their
origin. Although the majority of the endings keep to the origin (Greek or Latin), some have been
transformed throughout history and have obtained an English ending. Additionally, some are used both
ways, however this occasionally changes the meaning of the word.
Study these examples:
Latin endings

Singular

Plural

Greek endings

Singular

Plural

-us /-i (masculine)


-a /-ae (feminine)
-um /-a (neutral)

radius
formula
spectrum

radii
formulae
spectra

-is /-es
-on /-a

analysis
criterion

analyses
criteria

-ex/-ix /-ices

vertex
matrix
species

vertices
matrices
species

-ies/ 0
Notice:

Both used without any difference


Focus foci, focuses
Used with an English ending
Campus campuses; bonus bonuses; minus minuses; museum museums
Difference in meaning
Index (math.) indices

vs.

index (finger) indexes

Fill in the chart with the plural form of the words given.
Series
Nucleus
Basis
Phenomenon
Focus
Medium
Axis
Matrix
Crisis
5

Hypothesis
Agenda
Locus
D. Now you HW
1.

Some nouns are derived in a special way. For example: long-length/ grow-growth.
Now create adjectives and a verb from the nouns given.
Strength
Weight
Height
Width
Depth
Breadth

2.

Observe the following words. What do they have in common? What do they mean?
Tricycle, tricolour
Do you know some more examples?
Do you know other words formed in a similar way (with the prefix di-)?

Presentation topic.
Some tips for you.
OpenGL, Computer graphics
GLSL - OpenGL's shading language.
Cg - nVidia's shading language that works with OpenGL.
Java OpenGL - Java bindings for OpenGL.
OpenGL ES - OpenGL for embedded systems.
OpenAL - The Open Audio Library - designed to work well with OpenGL.
OpenSL ES - Another audio library.
Graphics pipeline
OpenGL support libraries
GLUT - The OpenGL utility toolkit.
GLU - Some additional functions for OpenGL programs.
Other graphics API's
Mesa 3D - An OpenSourced implementation of OpenGL.
Direct3D and Comparison of Direct3D and OpenGL - A competitor to OpenGL.
Light Weight Java Game Library
VirtualGL
External links
Official website
SGI's OpenGL website
OpenGL at the Open Directory Project

You might also like