CS 184: COMPUTER GRAPHICS
PREVIOUS
< - - - - > CS
184 HOME < - - - - > CURRENT
< - - - - > NEXT
Lecture #2 -- Th: 9/02/2004.
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: as many as you want to see different colors;
-- color map: input = # of bit planes; output = # of inputs to
all DACs
-- DACs to set the 3 intensities for RGB
-- The 3 RGB intensity signels determine the color of one pixel
displayed on the 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 8.9-8.10]
Standard Line-Drawing Abstraction (e.g., OpenGL API)
Pre-coded routines to do the low-level work for you:
Moveto(Pt),
Lineto(Pt),
Begin PolyLine -- Pt -- Pt -- Pt -- ... -- Pt -- End PolyLine.
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),
Haptic stylus,
...
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 (two standard graphics frameworks) define
six conceptual logical input devices:
- String: Get a tring of text.
- Locator: Return the coordinates of a position on the
screen.
- Pick: Find the primitive(s) under the current cursor
location.
- Choice: Select one of several different options (e.g.,
function keys).
- Valuator: Return the value from a slider or dial.
- Stroke: Capture a polyline of many subsequent cursor
positions.
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.
(This is the preferred interaction mode for client-server systems.)
[CH 3.2]
Administrative Intermezzo
All declared majors from the wait list should now be in the class. --
No
appeals forms necessary!
The bottlenecks are the 1-2 and the 2-3pm discussion sessions. Try to
avoid those!
The 3-4pm discussion session is almost empty !!
HW #1 -- how is it going ? ==> Deadline
extended till Wednesday, Sept. 8, noon !
Modeling versus Rendering
The computer graphics paradigm makes a clean distinction between the
(virtual) model
and a rendering (projection, display) of this model 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),
- a definition of the illumination
present (various lights).
Object Representation in CG
In general you would like to preserve the objects that you have
created
(e.g., your car_outline polygon of 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 our graphics courses at Berkeley we have created our own 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 the language (and system architecture) early:
See the "grand" picture; know the target of your system-building
efforts.
Basic concepts the SLIDE 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 Assignment #1 are the constructs:
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:
"BASIC CAR" -- Interactive Polygon Builder
PREVIOUS
< - - - - > CS
184 HOME < - - - - > CURRENT
< - - - - > NEXT
Page Editor: Carlo
H. Séquin