Lab 4: Lathe Objects
CS 142: The Mathematics of Computer Graphics,
Spring 2007
Due Date: Tuesday, Feb 13.
Goals
- Use POV-Ray to create lathe objects.
- Create your own include file.
Practice with Matrices
These will not be collected. We will go over them in class.
- What is the matrix for the 2D rotation by 30 degrees? What is the inverse matrix?
- What is the matrix for the 2D translation by 2 units along x and -3 units along y? What is the inverse matrix?
- What is the matrix for the 3D scale by 2 along x and 4 along z (y is unchanged)?
What is the matrix in the Povray format? What is the inverse matrix?
- What is the single matrix that represents a 2D rotation by 30 degrees
followed by a scale along x? (hint, write down each matrix separately and then multiply them together).
- What is the matrix that represents a shear along x by an amount proportional to y?
- What is the matrix that represents a 3D rotation by 25 degrees about the x axis (don't worry if
you get the clockwise vs counterclockwise directions wrong). What is this matrix in Povray's format?
- How do you convert degrees to radians? Radians to degrees?
- How do you define the sine function?
Lathe Objects
-
Read the tutorial on Lathe objects in Povray's help (2.3.1.1 Lathe Object). Try the examples in the tutorial.
Do you see the difference between linear, quadratic, and cubic splines?
-
Decide on a lathe shape that you want to make.
Using a piece of graph paper, draw the profile for this object. Mark the (x,y) coordinates of the points that you
will
enter into Povray. Deciding which points to use is not easy. Too many points can cause your shape to be lumpy. Misplaced
points (or too few points) can cause your shape to lose structure. Remember, if you use
quadratic of cubic splines, you need to add extra points at the beginning and/or end (see Povray tutorial).
Render a simple picture of your lathe object. Choose lighting and a camera angle that shows off the shape of the object.
Creating an Include file.
If you haven't already done so, give your lathe object a name using the #declare function in Povray.
Save this definition by itself into a new file with extension .inc. The full name
should be
yourLastName_objectName.inc
For example, see
orr_cup.inc.
-
Once you have created your include file, you should be able to use your lathe object
in a new Povray file by including it. For example, see
includeTest.pov. Try this out for the povray file you created above.
For this to work, you need to make sure the include file is in the same folder as
the povray file.
Summary of what to turn in
No later than class time on Tuesday, Feb 13, please do the following:
- Place the image of your lathe object on your website.
- Email to gorr:
- your include file (*.inc) containing the lathe object.
- your povray file (*.pov) containing the lathe object.
- a rendered image (*.png) of your povray file.
Please remember to place
"CS-142 Lab 4" in the subject line.
We will discuss the images during class on Feb 13.
[top] [Schedule]
[Home]