Docsity

Viewing using OpenGL - Computer Graphics - Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download Viewing using OpenGL - Computer Graphics - Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

Computer

Graphics

Lecture 41

Viewing Using

OpenGL

Also we will see:

 Clipping undesired portions

 Modeling transformation

 Projecting the model and

 Combining transformations

We will also discuss on how

to instruct OpenGL to draw

the geometric models. Now

we must decide how we want

to position the models in the

scene, and we must choose

a vantage point from where

to view the scene.

If we want to look at the

corner of the room

containing a globe, then

we must decide:

  • how far away from the

scene is the viewer?

  • and where exactly

should the viewer be?

We would like to ensure that the final image of the scene contains a good view:

that a portion of the floor is visible

all the objects in the scene are visible

objects are presented in an interesting arrangement.

All of these factors help

determine exactly what

image appears on the

screen.

Although ultimately a 2-D

image of 3-D models is

drawn;

yet we need to think in 3-D

while making many of the

decisions that determine

what gets drawn on the

screen.

Such operations include:

  1. rotation,
  2. translation,
  3. scaling,
  4. reflection,
  5. orthographic projection, and
  6. perspective projection. Generally, we use a combination of several transformations to draw a scene.

Since the scene is rendered on a rectangular window, objects (or parts of objects) that lie outside the window must be clipped. In three- dimensional computer graphics, clipping occurs by throwing out objects on one side of a clipping plane.

Overview: 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 1 ahead,

the steps might be the

following:

1. Arrange the scene to be

photographed into the

desired composition

(modeling transformation)

2. Choose a camera lens or

adjust the zoom (projection

transformation)

  1. Determine how large we

want the final photograph to

be - we might want it enlarged

(viewport transformation)

  1. After these steps are

performed, the picture can be

snapped or the scene can be

drawn