CSci 480 Lecture Notes
(Fall) Week One, Wednesday: Graphics Libraries
Handout: "A 3D Model Viewer for OpenGL" from Dr. Dobb's Journal,
July, 1998.
First project: pop up a window (or show an applet frame) and draw the following:
- A horizontal line.
- A vertical line.
- A diagonal line.
- A solid colored triangle with a border in another color.
- A solid rectangle.
- A solid rectangle rotated left 30 degrees.
- A solid colored round disk with a circular border in a different color.
- Some text saying "Oh what a pretty picture."
See the
fall projects
or
summer projects
page for additional details on report requirements. Run your program and get a screen
capture image of the window to paste into your report. Your report will
describe the program, show the resulting image, and
include the source code that you wrote. Comments in code are good. Do not
include automatically generated code or graphics libraries.
SRGP/SPHIGS
SGRP and SPHIGS are the 2D and 3D libraries included with the text book.
You will need to install the libraries in your SCF account in order to
use them.
| Advantages |
Disadvantages |
The text book gives examples
in SRGP and SPHIGS |
The user must install the libraries |
All course projects can be
completed using SRGP and SPHIGS |
Not used in industry |
| |
Not supported by UCS |
| |
Not not available for the PC (Wintel) |
Table 1: Advantages and Disadvantages of SRGP and SPHIGS
X-Motif
X-Motif is the industry standard middle-level GUI library that includes
many 2D graphics primitives.
| Advantages |
Disadvantages |
| Supported by UCS |
Does not include 3D modeling or rendering support |
All course projects can be
completed using X-Motif |
|
| Includes many 2D primitives |
|
| Industry standard GUI for Unix programming |
|
Table 2: Advantages and Disadvantages of X-Motif
Java
Java is a new high level language that resembles C++ but is much easier
to learn and has a cross-platform GUI. The built-in graphics class has
several 2D primitives that can be used to complete the projects in this
course.
| Advantages |
Disadvantages |
| Supported by UCS |
|
All course projects can be
completed using X-Motif |
|
| Includes many 2D primitives |
|
| New
Java3D library |
|
| Cross-platform GUI for Web programming |
|
Table 3: Advantages and Disadvantages of Java
OpenGL
OpenGL is the "open" standard graphics library that evolved from Silicon Graphics'
IRIS GL for the Irix (flavor of Unix) platform. Designed from the beginning for
3D graphics, this library has become an industry standard for high powered scientific
applications and is now becoming popular for PC game programming.
| Advantages |
Disadvantages |
Built in to Microsoft Visual C++
with tutorials and examples |
Not supported by UCS |
All course projects can be
completed using OpenGL |
Must be user-installed if using
UCS-SCF Unix machines; |
| Includes 2D and 3D functions |
|
| Industry standard for 3D graphics |
|
Table 4: Advantages and Disadvantages of OpenGL
Example: "HelloLine" Applet with the Java AWT

The
HeloLine Applet.
Source code
for this applet is available publicly.
This page established September 6, 1998; last updated September 12, 1999.