CMPS 160 -- Lab Assignment 5
Due date:
Midnight, Friday, May 22, 2015
Objectives:
Texture map an object.
Description
-
Classical texture mapping allows you to make your scene look more complex
than it really is. The main idea is to apply an image as a ``sticker'' onto your objects.
The tricky part is figuring out how to apply the sticker i.e. figuring out the texture
coordinates.
For this assignment, you will apply a
tiger texture onto your shark model.
-
To facilitate the mapping, you will conceptually do the following:
(1) first apply the texture onto a sphere,
(2) center the shark within the sphere,
(3) trace the vertex normals outwards till it intersects the sphere --
that is the texture coordinate you want for that vertex.
In practice, what you need to do is convert the vertex normal into a
row and column index for your texture map.
The row index corresponds to distance from the poles:
map row 0 to north pole, and last row to south pole.
The column index corresponds to longitude:
map column 0 to 0 degrees, and the last column to 360 degrees.
Note that in this mapping, the first and last columns overlap.
You may wish to make minor adjustments so that they don't overlap (optional).
-
To convert a vector to angular values,
assume the z-axis is aligned with the north and south poles
while the x-y plane is on the equatorial plane.
The latitude angle can be obtained by finding the angle between the vector
and the positive z-axis.
The longitude can be obtained by first projecting the vector onto the x-y plane
then finding the angle between the projected vector and the x-axis
(assume that longitude is 0 degrees if it's aligned with the x-axis).
Use right hand rule to determine positive rotation angles.
Grading:
This program will form part of your CMPS 160 grade.
The other components of CMPS 160 grade are your midterms and final project.
The header block should contain at least the following information:
name, cruzid, date, and brief description of your program.
This will be true for all future assignments and programs.
Rubric:
5 header blocks
5 code readability
10 inline comments
80 some reasonably looking ``tiger shark''
Who graded your assignment:
matthew: ahosick -- jbernay
jiayu: jchen160 -- tmlinejo
Submission:
Submission must be done using the "submit" command from CATS.
- submit cmps160-ap.s15 lab5 lab5.tar, or
- submit cmps160-ap.s15 lab5 lab5.zip
This command should work from unix.ic.ucsc.edu.
Create and submit a subdirectory called lab5.
IT SHOULD CONTAIN ALL THE FILES NECESSARY FOR THIS PROGRAM TO RUN.
Tar or zip up lab5 before submitting.
Last modified
Wednesday, 13-May-2015 09:13:20 PDT.