Introduction

Activity

Download handout and code to create an Xcode executable OpenGL console application.

Image Generation?

In a small group, for each of the following images, identify whether it is a photograph, a computer generated image or a painting. What "quality" of the image governed your identification? Jot down your justifications and hand in at the end of class.

Sunset

Fisherman

Whiskers

too cute

Pebbles

pebbles

Glasses

glasses

Water

water

Head

Car

Bolts

bolts


Animations taken from the Electronic Theatre Archive of SiGGraph


The generation of a CG image is a process that might be depicted as

Modeling

What needs to be modeled?
Will precise mathematical models be necessary?
Can we use approximations? Why might this be necessary?

Representation

What programming language and data structures will be used?
What GL API is suitable for our needs?
Should we use an OS specific window toolkit or an OS independent toolkit?
Is a driver program needed for event handling?

Render

Which rendering algorithm will be used (tightly linked to GL API)? - do we want photo-realism or real-time animation/simulation?
How does the renderer process data?

Display

Where is the image displayed on the screen?
How is the display generated?

UI

Is user interaction supported?
How is user input retrieved?
How does the input affect the data representation?

These questions and many others are addressed in this course.


Modeling Discussion

(Modeling is challenging!) This course addresses both

2-D and 3-D modeling concepts necessary for introductory CG image generation.

Q1: What needs to be modeled? (Identify the elements that are necessary to display a computer generated image.)

Q2: What is the correct mathematical model (for a unit circle centered at the origin)?


Q1: What needs to be modeled?

All objects in the scene - position and dimension, materials, colors, textures, collidable, ...
The world boundaries and projection type (perspective or orthographic)
The observer or camera - moving, stationary, first-person, third-person, ...
Lights - directional, positional, spotlight, ...
Special effects - fog, depth of field, stenciling, transparency, ....

Q2: What is the correct mathematical model (for a unit circle centered at the origin)?
x2 + y2 = 12

So? The equation for a circle is continuous and an infinite number of points define its circumference.

How do we generate points to display on the circle's circumference?

x = r cos       y = r sin

How many points should be generated? What values of should be used? Can we be clever?

Yes we can, by taking advantage of a circle's eight-way symmetry. Note that the following image does not depict a unit circle but the concept holds for all circles, centered at any location.

So, calculate one point on the circumference and we get seven others by merely changing signs and transposing (x, y).

Given this information, what values of should be used?
Points will only have to be generated through a 45° angle or the arc from (0, r).

End Note

Eight-way symmetry and a simple incremental point algorithm, attributed to Bresenham, is typically implemented in hardware (more later). A GL API might provide a circle primitive directly. If not, the CG programmer should understand how to model, represent, and generate circle points efficiently by taking advantage of state of the art practices.