Authors: Donald Hearn and M. Pauline Baker. ▫ ISBN: 0-13-015390-7 ... C or
C++ reference book ... Goal: to provide a broad exposure to the computer
graphics.
Computer Graphics 1 Instructor Information z z z z z z z
Instructor: Dr. Jessica Bayliss Office: 70-3509 Telephone: (585) 475-2507 Office Hours: see my web site Web page: www.cs.rit.edu/~jdb Teaching Philosophy: www.cs.rit.edu/~jdb/teachingPhilosophy.html Email: jdb (on CS systems - @cs.rit.edu)
Books z
Required Textbook
z
Title: Computer Graphics with OpenGL 3/E Authors: Donald Hearn and M. Pauline Baker ISBN: 0-13-015390-7 Publisher: Prentice Hall Copyright: 2004
Suggested References
OpenGL reference book C or C++ reference book
RIT Computer Science Dept.
RIT Computer Science Dept.
Course Goals and Outcomes z
Goal: to provide a broad exposure to the computer graphics field in order to be prepared for follow-on study
z
Outcomes
Appreciation of the history and evolution of computer graphics, both hardware and software. Understand/implement 2D graphics and algorithms including: line drawing, polygon filling, clipping, and transformations. Understand concepts of and techniques used in 3D computer graphics, including viewing transformations, hierarchical modeling, color, lighting and texture mapping. Exposed to current computer graphics research areas. Ability to use a current graphics API (OpenGL). Introduced to algorithms and techniques fundamental to 3D computer graphics. Ability to reason about and apply these in new situations. RIT Computer Science Dept.
Graphics? What is graphics? z How is it useful? z
RIT Computer Science Dept.
Where are computer graphics?
Where are computer graphics? z
z
Art, Entertainment, and Publishing
Image Processing Photo enhancement, image analysis, printing
Movies,
television, games, art, web, books, magazines
iD Software – Doom 3.
RIT Computer Science Dept.
Original X-ray.
Unsharp mask result. RIT Computer Science Dept.
1
Where are Computer Graphics?
Where are computer graphics? z
Process Control Status
z
displays
Computer-aided Design Architecture,
circuit design
A day at Springfield Nuclear Power Plant Cyan’s world of Riven under construction. RIT Computer Science Dept.
RIT Computer Science Dept.
Where are Computer Graphics? z
Visualization Display
What isn’t computer graphics? z
of data
Graphics is NOT image processing, but image processing can use techniques from graphics and vice versa
Mathematica displays a complex mathematical surface
RIT Computer Science Dept.
RIT Computer Science Dept.
Line Drawing Devices and Vector Displays
Graphics Display Devices z
Hardware devices used to display computer graphics: Line
Drawing Devices Vector Displays Raster Displays Flat Panel Displays Hard-Copy Raster Devices RIT Computer Science Dept.
z
z
The classic line drawing device is the pen plotter. Raise pen, move paper, drop pen, move paper, etc. Vector Displays Internal circuitry sweeps an electronic beam from point to point across the face of a cathode ray tube, leaving a glowing trail.
RIT Computer Science Dept.
2
Raster Displays z
Raster display pixels are identified by (x,y) coordinates Note
Raster Displays z
orientation – (0,0) at top left
RIT Computer Science Dept.
RIT Computer Science Dept.
Video Monitor
Video Monitor z
z
Important component: frame buffer Holds the image to be displayed Each pixel is represented by data in the FB Display refreshed (redrawn) line by line, top to bottom – May alternate rows (0, 2, 4, …, 1, 3, 5, …) to avoid flicker
Based on cathode-ray tube (CRT) technology
z
Number of “planes” in FB determines the color depth Each pixel represented by one bit in each plane Six planes Æ six bits per pixel Bits are paired; pairs associated with colors (RGB) Two bits per color Æ four voltage/brightness levels Thus, 4x4x4 = 64 different color combinations Input/Output characteristics of a two bit DAC: Value 00
Voltage 0.0 * Max
01
0.333 * max
10 11
RIT Computer Science Dept.
Video Monitor z
Alternate color scheme: use a lookup table (LUT) Programmable
z
Number of colors displayable is dependent on width (w) of whatever drives the color guns
z
Number of colors displayable at one time depends upon depth of the FB in bits (b)
entries can be N-bit per color Æ wider color palette
LUT
z
RIT Computer Science Dept.
1.0 * Max
Display Characteristics
association between FB and
color
0.666 * Max RIT Computer Science Dept.
E.g., 24-bit LUT Æ 224 colors Æ 16,777,216 colors
E.g., 8-bit FB Æ 28 colors Æ 256 colors
Normally, w > b
RIT Computer Science Dept.
3
Display Comparisons z
Relative cost of direct vs. LUT approaches.
Flat Panel Display z
Alternate approach to raster display Grid
wires control polarization of LC molecules. Either block light or allow it to pass through.
RIT Computer Science Dept.
RIT Computer Science Dept.
Active Matrix and Plasma Panels z
Active matrix panels
LCD panels with tiny transistors at each pixel. Brightness is controlled by adjusting the liquid crystals proportional to the electric field. The transistors provide memory that holds the crystals in their adjusted state
Hard-Copy Raster Devices z
z
Plasma panels
Tiny neon bulbs at each pixel, controlled by an electric field. Also provides memory.
z
Remembering Math
Different devices send different types of input:
String - sequence of characters. Choice - selection from a set of options. Valuator - value within a range (e.g., 0.0-1.0). Locator - position (usually in some coordinate system).
Pick - identifies a portion/segment of the image.
z
Different printers produce same basic image (barring quality differences). RIT Computer Science Dept.
Graphics Input Devices z
PostScript PDF TIFF, etc.
PostScript is device-independent
RIT Computer Science Dept.
Film recorders Laser printer Inkjet plotter
Printers accept print jobs in the format of a page description language
– No need to constantly refresh the display.
z
Various types of printed output
Types of devices:
Basic math useful for graphics discussed z Please see the tutorial off of the web site for practice z
Keyboard Mouse, joystick, trackball Buttons Tablet Knobs RIT Computer Science Dept.
RIT Computer Science Dept.
4
Elements in CGI z
The basic objects of pictures are output primitives
Polylines z
Polylines
Example:
sequence (2,4), (2,11), (6,14), (12,11), (12,4), etc. Each pair of points defines a line segment This is a line drawing
Text Filled
regions images
Raster
RIT Computer Science Dept.
RIT Computer Science Dept.
Polylines z
Terms: Edge – line segment in multi-line polyline
z
Polylines z
Vertex – endpoint of two edges
Polylines can be open or closed Open – first and last points are not connected by a line segment Closed – forms a polygon
Can vary line attributes to alter appearance Thickness – in terms of point size Composition – continuous, dashed, arrows
• At vertices, can alter method of joining
RIT Computer Science Dept.
RIT Computer Science Dept.
Text z
A polyline is a connected sequence of straight lines
Text
Two distinct display modes
Can alter fonts (typefaces) z Can represent characters as polylines or bitmaps z
Text
mode – built in characters with limited positioning. Graphics mode – Richer set of character shapes and positioning.
West of House You are standing in an open field west of a white house, with a boarded front door. There is a small mailbox here. >open mailbox Opening the mailbox reveals a leaflet. >get leaflet Taken. >read it "WELCOME TO ZORK!
Text mode - Zork
RIT Computer Science Dept.
Graphics mode
a) polylines
b) bitmap
RIT Computer Science Dept.
5
Filled Regions z
Commonly, polygons with a color, pattern or texture
Raster Images z z
Array of small cells. Each cell represents a pixel. Often
Color
Pattern
Texture
RIT Computer Science Dept.
RIT Computer Science Dept.
Raster Images Simplest form of a bitmap – two levels, one bit per pixel, or a pixel depth of 1. z To generalize, a pixel depth of n has 2n possible levels. z
RIT Computer Science Dept.
called a pixel map, or bitmap
Raster Images Lines that are not horizontal or vertical suffer the jaggies when zoomed in on. z Antialiasing is a technique used to minimize jaggies. z
RIT Computer Science Dept.
6