The assignment: is to learn how to use SPHIGS.
References: Sections 7.3, 7.4, 7.5, and 7.7 of the text
/usr/local/studata/COURSES/cs5721/srgp_sphigs/SPH_DISTRIB/include/sphigs.h
Also see the sample programs in the
srgp_sphigs/SPH_DISTRIB/examples subdirectory of
the class account.
Finally, there is a "SPHIGS documentation manual" in the file
sphigs.ps in the subdirectory
srgp_sphigs/SPH_DISTRIB/doc of the
the class account, which I will give you, or you can print out with:
% lpr /usr/local/studata/COURSES/cs5721/srgp_sphigs/SPH_DISTRIB/doc/sphigs.ps
Discussion:
There is a simple program called
lab3.c
in the
lab3
subdirectory of the class account.
There is also a
Makefile
there (and a Makefile for use on
cs
machines:
Makefile.cs
).
If you compile and run this program you will see a 3-D House on the screen.
There is also a very sophisticated program
SPHDEMO
in the
demo_directory
of the
lab3
directory that demonstrates some of the
capabilities of SPHIGS (the README file there explains how it works).
Your task is to make the following modifications to
lab3.c
so that it creates a STREET_SCENE structure. Here are the modifications:
(1) Do modeling transformations on the given house to make a Mansion and
a Cottage. The code to help you to do this is given on the page 307,
program 7.10 of the text book.
The mansion can be formed by first scaling the given house by 2.0, 3.0 and
1.0 in x, y and z directions. The next steps are rotation and translation.
(2) Add a chimney to each of the houses (see Section 7.5).
(3) Add new colors and change the color scheme of the houses
to that shown in Figure 7.20 page 321 (see Section 7.7).
The function to use is:
SPH_loadCommonColor (index, common_name);
(4) Add a cube and a pyramid on top of it
to make a "shed" in the scene.
(5) Read the viewing specification (VRP, VPN, VUP, PRP, etc.)
from a file, rather than have it hard-coded as it currently is in
lab3.c starting about line 25.
Hint: you will have to change the viewing specification to see
all of the mansion.
WARNING!!: The functions given in the text don't all work as shown. Some actual SPHIGS functions are different. Here is a list of things that might be useful:
SPH_setModXform( SPH_rotateY(90.0, temp_matrix), ASSIGN )
What to turn in or demo:
Since this lab has visual aspects that can most easily be observed,
you will be asked to do a demo of your program.
Turn in or do the following items from the
Computer Science Lab Report Format:
1. (1 point) The Basic Information (your name, class, section,
TA's name, assignment number, and date) can be on a separate cover sheet or as
(highlighted) comments at the top of your main program file.
2. (1 point) The Problem Statement is a brief description of
The assignment: above. Note: the problem statement can (and should)
be in a comment at the top of your main program file.
9. Extra Features (- if done.)
11. (5 points) Include the Program Listing(s).
These listings should show good style,
be appropriately commented, have the new parts
highlighted that you added to the original lab3.c code,
and include handwritten explanations if it helps the
reader's understanding of the code.
13. & 14. (8 points) Do "demos" of each of the features
of your program.
15. Include a description of any Known Bugs if needed.
You may be able to gain back lost points by a careful analysis of
what went wrong and possible fixes.
16. This is optional (and no points usually),
but it is useful to think about Possible Improvements.
Obviously there are many for this program.
17. Comments on the lab assignment are also optional
(and again, no points usually), but appreciated!
Important Note: You may discuss algorithms with other students, but the program and lab report should be your own work.