
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: ADV COMP GRAPHICS; Subject: Computer Science; University: University of Maryland; Term: Spring 2001;
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Due: 4:00pm Wednesday, March 28, 2001
This assignment involves rendering in 3D with transformations but no illumination. Datasets are at: http://www.cs.umd.edu/class/spring2001/cmsc740/assg2/data/ All code must be your own.
(a) Write code to read the data files for this assignment and compute the axis-aligned extents (minimum and maximum along x, y, and z). The format for the data files is:
v x 1 y 1 z 1 r 1 g 1 b 1 v x 2 y 2 z 2 r 2 g 2 b 2 .. . v xn yn zn rn gn bn f i 11 i 12 i 13 f i 21 i 22 i 23 .. . f im 1 im 2 im 3
This file has m faces (assume all are triangles) and n vertices with coordinates and colors. Each triangle has three indices ijk that each references a vertex 1 ≤ ijk ≤ n. (5)
(b) Using the information on bounding box extents and its center your program should deter- mine the viewing parameters such that the entire dataset lies inside the view window. Display the data using colored polygons. The data is pre-lighted (vertex colors incorporate illumination) and so you do not have to use any illumination. (5)
(c) Implement zoom on the right mouse button that lets you zoom into and out of the dataset. The center of the zoom should be the center of the bounding box of the dataset (which need not be the same as the origin of the dataset coordinate system). (2)
(d) Implement rotation on the left mouse button. The center of the rotation should be the center of the dataset (again, this need not be the center of the dataset coordinate system). The axis of rotation should be perpendicular to the direction of mouse movement in the screen space and should pass through the center of the dataset. For instance, if the mouse is dragged along the screen X, the dataset should rotate about the vertical axis as seen in the screen space (which may or may not correspond to the dataset x, y, or z axes). Similarly if the mouse is dragged along the screen Y, the dataset should rotate about the horizontal axis as seen in the screen space. (8)
(e) Make sure that your rotation is compatible with zoom, i.e. if you zoom out and then rotate you are rotating in a zoomed out mode. Also make sure that your program works for a data file that is off-center (i.e. whose center does not lie on the origin). (5).