CMP 160 -- Programming Assignment 1
Due date:
10:00am TUES, 10/5/99
Objectives:
Warm up program to take care of any technical
difficulties, administrative issues, etc. that
you might run into. Also introduces OpenGL.
Understand coordinate system of OpenGL, and how
to draw basic primitive shapes such as rectangles,
lines, and text.
To Do:
-
Study and run
prog.c --
it gives you a simple framework for doing 2D graphics with OpenGL.
-
You will modify this startup program to do some simple data plotting.
Specifically, parse the file from
http://www.cse.ucsc.edu/cgi-bin/cgiwrap/~pang/last5 and plot
the data for "today's" data. The fields from left to right
are: date, time, temperature, average wind, wind gust, and
direction. You should at least plot the time and average wind
information. This file is updated once every 30 minutes between
noon and 5:30pm everyday. Readings can be assumed to be averaged
over the last half hour.
-
The format for plotting this data is open ended. As examples,
you can refer to:
-
http://www.windcall.com/reports/ --
click on one of the
sites with a wind reading. In case it says "Waiting for
wind" on all the sites, you can either check back later
in the day; or click on a previous day's plot for any one
of the site.
-
http://ipmml.cse.ucsc.edu/SlugVideo/wch-weather.html and
select "Two Hour Winds" or "Daily Winds" --
one difference between these plots and the previous one is that
they use a sliding time window rather than a
fixed start/end time per day. For our data set, a fixed
start/end time may be easier.
UPDATE:
The 2d text call is now working! If you have not seen this message before
and have already downloaded the files please re-download prog.c! ..or at
least look at it for the minor changes. All others (graphics.h, gui.h,
gui.c, and the makefile) have not been modified. To print 2d text, you
can call print_string(char *s, double x, double y). Thanks for your
patience. -Jack
Notes:
-
You can modify the following to suit your preference:
graphics.h ,
gui.h ,
gui.fd , and
gui.c .
If you're planning to use the simple xforms interface that's provided,
you probably won't have to modify any of the gui.* files.
Otherwise, you will need to modify the gui.* files
(e.g. if you're doing development on Windows, or if you plan
to use GLUT, Tcl, or other GUI tools).
The
makefile for compilation on the suns is also provided.
-
You can use C, C++, or other language with OpenGL bindings.
You'll need to make the appropriate changes to the makefile.
-
Submission must be done using the submit or xsubmit utility from CATS.
Run "quickhelp submit" on a CATS machine to find out more info.
Create and submit a subdirectory called "prog1". It should
contain all the files you have in make your program compile/run.
This includes folks using Windows/NT/MAC environments.
-
Grading guide
Last modified
Monday, 11-Oct-1999 10:42:03 PDT.