Assignment is still subject to change
Problem 1.1 (20 points). Practice exercise 2.3.1 Drawing the checkerboard, p. 68.
Write and run a routine that draws a checkerboard
similar to Figure 2.33 b).
Your classmates' solutions (protected
directory)
Hints
See How to run your homework problems
For programming problems, submit a report, code files, and a compiled executable.
Assignments are submitted electronically in one zip file
attached to an email. You must use the directory
structure
YourLastName
Assign1
Problem1
Problem2
In each file of text, code, or documentation, include your name so when I
print it, the paper is identified.
In the directory Problem1, include one file (text, HTML, or Word)
In each program directory, include:
- readme.txt, readme.html, or readme.doc. Report including sections
- Requirements: What problem are you solving? E.g., restate the problem
from the book.
- Specifications: What would a good solution look like? E.g., "similar
to Figure 2.33 b)."
- Design: Describe your strategy for solving it. That is, how did you
figure it out? E.g., how to the book's parts fit together?
- Describe the structure of your solution. That is, how is your program
organized? E.g., class diagram or discussion of functions.
- Implementation: List the names of code and other files and their function
- Testing: What assurance have you that the image is correct? Hint: "Looks
right" is not enough.
- [If applicable] What have you done you consider to be worth a grade
> 80?
- What did you learn from this exercise?
For this assignment, the report should be 1-2 pages. It is NOT expected that
you discuss the details of how each function or each line of code does its
job.
- main.cpp. This is the file that
contains main()
- *.cpp. Any other C++ files
- (Optional) Any other files, e.g., data files
- main.exe. A Windows command line executable. I will double-click
this file, and I should see your image.
The code should be self-contained. That is, on a system with the OpenGL *.h
and *.lib files, I should be able to compile your code.
Good programming style is expected. That includes
- Meaningful comments
- Meaningful variable names
- Consistent indentation
- Avoid "magic numbers"
- Object oriented
- Whatever else you have learned
See also Elements of C/C++ Coding Style
(PDF file) from Virginia Tech
I consider the book's code not well documented, so you should add value there.
Indentation: Beware <tab> characters. Sometimes <tab> is
3 characters, sometimes 4, sometimes 8, sometimes others. Consequently, mixtures
of <tab>s and spaces almost never looks the same to me as it looks to
you. I recommend no <tab>s.
I consider the book's code not very object oriented. Do not get carried away,
but look for ways to add value there.
Recall that if you complete the assignment as required, your grade is 80.
To earn a higher grade, you must do more than "write a routine that draws the
checkerboard."
Own work
Assignments will be a solo effort. Credit the sources you consult. The risks
of plagiarism are too great to justify the possible rewards. Do your own work.
You are strongly encouraged to discuss that work with me and with appropriate
content experts as it proceeds. If you are in doubt about what is appropriate,
you should consult with me in advance. In general, you are OK if you have added
value to any assistance you receive, provided you make it clear in your reports
what assistance you received and its source.
See Scholarship.
It is permitted to discuss your work with classmates. You may look at
each other's code, and you may help each other find errors. If you receive assistance,
in the "What did you learn from this exercise?" section of your report,
tell what assistance you received from whom.
Your report and your code should be yours. You should not exchange code either
on paper or electronically with classmates.
There is a fine line between looking at each other's code and copying it. If
there are two independent developments, that is OK. You should help the other
person as much as they help you. If one person does all the work, that is outside
these guidelines.
I expect code you get from the book to look alike. I expect code you write
to look somewhat different. At the very least, you had better be able to explain
to me any code you use.
"Computer graphics is mastered most quickly by doing it." -- Hill,
p. 39
I will make copies of some homework papers public through either electronic
or physical means. You should prepare each assignment so that you will be proud
to have it displayed for public scrutiny.
|