CS 184: COMPUTER GRAPHICS
PREVIOUS
< - - - - > CS
184 HOME < - - - - > CURRENT
< - - - - > NEXT
Lecture #2 -- We: 8/28/2002.
Brief Review
The
three pillars of Computer Graphics
Trends
in Computer graphics
Calligraphic
Devices versus Raster
Devices.
Drawing/Painting on Raster Devices
A more detailed look at a Frame
Buffer -- the heart of a Raster Device.
(bit planes --> color map --> DACs for RGB --> color CRT).
Foil: How to draw a banana or a thin line ?
Foil: Which
PIXELS should be turned on ?
(E.g., Bresenham algorithm to turn on "the right" pixels efficiently.)
[Ch 7.8-7.9]
Standard Line-Drawing Abstraction (e.g., OpenGL API)
Pre-coded routines to do the low-level work for you:
Moveto(pt),
Lineto(Pt),
Begin Poly-Line -- Pt -- Pt -- Pt -- ... -- Pt -- End Poly-Line.
You will use such routines in your first programming assignment.
Basic Interactive Graphics - - First homework assignment.
ASG #1: How to draw lines interactively on a raster device.
You will be using a standard mouse to define vertices on the
screen,
which then get automatically connected by straight line segments.
With proper software support, a mouse is a very versatile device
and can be used for pointing, drawing, flying through virtual space,
controlling the view of the scene, modifying objects.
Interaction Devices
Mouse is not the only interaction device. There are many others.
To get an idea: Read: Ch 3.2
These are some of the physical input devices that you may hear
about in this course:
Keyboard (input character codes),
Lightpen (absolute positioning on screen),
Tablet (absolute positioning on desktop),
Mouse (relative positioning),
Trackball (relative positioning),
Joystick (velocity control),
SpaceBall (6 DoF velocity control),
Polhemus Magnetic Wand (3D position input),
Data Glove (3D position and gesture input),
...
All these devices need to be supported with proper software.
To reduce that burden and to exploit the conceptual similarities of
many of these devices,
a few "logical input devices" are defined with corresponding
generally usable APIs.
One typically defines for each device a "measure" describing
the value(s) returned by the device,
and a "trigger" which is a signal that generates an event in
the graphics program.
PHIGS and GKS define six conceptual logical input devices:
String, Locator, Pick, Choice, Dial, Stroke.
OpenGL works at a slightly lower level; many of the above functions
are synthesized
from basic position information and appropriate context-sensitive
software;
these pieces of the user interface, often associated with separate
small windows
(e.g., pull-down menues or sliders) are also called "widgets".
Different relationships between the measure process and the trigger
event define different input modes:
Request Mode: The measure is sent to the computer upon request by
a trigger activation.
Sampling Mode: The measure is read immediately upon the corresponding
function call.
Event Mode: Trigger actions place measure values on an event queue.
Callback
functions respond to these events.
(Preferred interaction mode for client-server systems.)
[CH 3.2]
Modeling versus Rendering
The computer graphics paradigm makes a clean distinction between the (virtual)
model
and a rendering (projection, display) of it from a particular viewpoint.
[Ch 1.6]
To generate a computer graphics display of a scene, we need three things:
a representation of the scene (geometry, surface color, materials),
a specification of a camera (observer, viewer),
definition of the illumination present (various lights).
Object Representation in CG
In general you would like to keep the objects that you have created
(e.g., your fish-like polygonof ASG#1).
How can you do that ? Core dump from memory ? Printing out all data
structures ?
A terse minimal set of information that will permit to recreate the
polygon ?
It would be great if somebody else also could read your data and draw
your polygon ...
==> We need a standard polygon interchange format !
That also goes for the more complicated objects that you will create
later in the course.
For this course we have created our own simple format to define objects
and scenes:
==> "SLIDE".
(Its semantics is very close to OpenGL).
"SLIDE" : Scene Language for Interactive Dynamic Environments
FULL SLIDE DEFINITION
is posted on the WEB.
The SLIDE language emerged from more than a decade worth of experience
with a whole series of formats to define graphics objects and scenes.
Some of the intermediate formats were:
OSF (Object Specification Format) -- Specifically for CS 184, 1985.
OFFOS (Our Format For Object Specification) -- 1987.
SDL (Scene Description Language) -- 1990.
GLIDE (Graphics Language for Interactive Dynamic Environments) --
1994.
SLIDE (Scene Language for Interactive Dynamic Environments) -- 1997.
[We needed to avoid a trademark infringement against
3DFX's "Glide"
which they had trademarked for their low level API
for video game graphics.]
Reason why we give out language early:
See the "grand" picture; know target of your system-building efforts.
Basic concepts in language:
compact, yet readable and editable format;
easy to parse, and extensible syntax;
geometry contained in vertex coordinates, instance placements;
topology information explicitly captured in connectivity between vertices
and faces;
This is called a "boundary representation" or B-rep for
short,
(we omit discussion of hierarchy and time dependence for today).
All you need to know of SLIDE for ASG#1 are the constructs:
point,
face, object.
This B-rep can easily be extended to 3-dimensional objects.
Reading Assignments:
Study: 2ndEd: Ch 1.6, Ch 2.2, Ch 3.1-3.2, Ch 7.8-7.9,
Study: 3rdEd: Ch 1.6, Ch 2.3, Ch 3.1-3.2,
Ch 8.9-8.10,
Skim: 2ndEd: Ch 3.5,
Skim: 3rdEd: Ch 3.5,
Current Homework Assignment:
ASG#1:
"Fantasy Fish" -- Interactive Polygon Builder
PREVIOUS
< - - - - > CS
184 HOME < - - - - > CURRENT
< - - - - > NEXT
Page Editor: Carlo H. Séquin