Assignment 2 Questions - Advanced Computer Graphics | CMSC 740, Assignments of Computer Graphics

Material Type: Assignment; Class: ADV COMP GRAPHICS; Subject: Computer Science; University: University of Maryland; Term: Spring 2001;

Typology: Assignments

Pre 2010

Uploaded on 07/30/2009

koofers-user-fia
koofers-user-fia 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Assignment 2
CMSC 740, Spring 2001
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 x1y1z1r1g1b1
v x2y2z2r2g2b2
.
.
.
v xnynznrngnbn
f i11 i12 i13
f i21 i22 i23
.
.
.
f im1im2im3
This file has mfaces (assume all are triangles) and nvertices with coordinates and colors. Each
triangle has three indices ijk that each references a vertex 1ijk 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 zaxes). 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).

Partial preview of the text

Download Assignment 2 Questions - Advanced Computer Graphics | CMSC 740 and more Assignments Computer Graphics in PDF only on Docsity!

Assignment 2

CMSC 740, Spring 2001

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).