The Programmer's Interface
Tom Kelliher, CS 320
Jan. 30, 1998
Announcements:
From last time:
- Installed GLUT.
- Experimented with two OpenGL programs.
Outline:
- The programmer's interface.
- Pictorial history.
- Modeling-Rendering Paradigm.
- Graphics architectures.
Assignment:
An API must allow us to specify:
- Objects --- collections of polygons. API primitives:
- Points.
- Line segments.
- Polygon outlines.
- Filled polygons.
- Curved surfaces (not supported by all APIs).
OpenGL example:
glBegin(GL_POLYGON);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);
glVertex3f(0.0, 0.0, 1.0);
glEnd();
specifies a triangle.
Adding additional vertices allows arbitrary polygons.
Other type parameters: GL_LINE_STRIP
, GL_POINTS
.
- The viewer --- through the synthetic camera:
- Position.
- Orientation.
- Focal Length.
- Size of film (projection) plane.
- Light sources:
- Location.
- Direction.
- Strength.
- Color.
- Material properties --- transparency, etc.
All must be supported by the API.
Refer to Plates 25 through 36 in the text:
- Wireframe images. Complex 3-D objects.
- Hidden surface removal.
- Flat shading. Lost 3-D. No light source.
- Constant shading. Found 3-D. Light source. Still see the
polygons.
- Smooth shading. Polygons less obtrusive.
- Curved surfaces. Polygons gone.
- Multiple light sources.
- Texture mapping.
With graphics accelerators, the more sophisticated renderings are ``free.''
Alternative to synthetic camera.
Modeler, interface file, renderer.
- Modeler:
- Concerned with design and placement of objects.
- Highly interactive process.
- Possibly more than one modeler, tailored to each application.
- Interface file:
- Output from modeler, input to renderer.
- Basic description of scene.
- Renderer:
- Adds lighting, viewer perspective, material properties (additional
components of interface file).
- Computationally intensive.
- PIXAR's Renderman.
Host, DA converter, CRT.
- Eliminating flicker.
- Re-displaying a scene: computationally expensive.
Host, display processor and display list, CRT.
- Separate processor.
- Host sends primitives along, stored in display list.
- Display processor deals with refresh, re-generation.
Consider a pipeline for computing large numbers of .
Properties of pipelines:
- Depth --- latency.
- Throughput.
Steps in a graphics pipeline:
- Transformation --- between series of coordinate systems. Matrix
multiplications.
- Clipping --- cut scene down to field of view. Example: Excel.
- Projection --- Project 3-D objects into 2-D. Matrix multiplication.
- Rasterization --- Convert 2-D primitives to pixels.
Thomas P. Kelliher
Thu Jan 29 08:36:58 EST 1998
Tom Kelliher