Docsity

Introduction to Computer Graphics - Assignment | CS 470, Assignments of Computer Graphics

Toggle sidebar
bg1
Homework 5 : Due Sept. 26, 2007
CS 470
September 23, 2007
1 Transformations and Parametric Surfaces
The goal of this homework is to gain experience with modeling and viewing transformations and
parametric surfaces. The scene to be rendered consists of a parametric surface and several orbiting
shapes. The orbiting shapes are to be drawn using glutSolid* functions. The models will continu-
ally rotate using time-based animation and glut callback functions. The objects are to move along
circular paths with radius = 1.
The parametric surface is given by
x= cos(a)(n+ sin(b) cos(a/2) −sin(2b) sin(a/2)
2)
y= sin(a)(n+ sin(b) cos(a/2) −sin(2b) sin(a/2)
2)
z= sin(a/2) sin(b) + cos(a/2) sin(2b)
2
for 0 ≤a≤2π, 0 ≤b≤2πand n = 1.0. Plot the surface by evaluating this equation at points
evenly spaced in the a,b domain.
1.1 Specification
Your will create an interactive 3D application with the following features:
•10% - Open a 512 ×512 window. The text in the titlebar should read ’Homework 5’. The
background color should be black, and the frame buffer should contain a depth buffer for
hidden surface removal. Render your name in the lower left hand corner. Create a perspective
viewing volume sized so that everything is clearly visible and undistorted, and the surface is
in the center of the screen.
•10% - Render the surface using points. Select this mode using function key F1.
•10% - Render the surface using lines. Select this mode using function key F2.
•10% - Render the surface using triangles. Select this mode using function key F3.
•10% - Draw a red dodecahedron rotating about the x-axis at 1 revolution per second.
•10% - Draw a green octohedron rotating about the y-axis at 1.5 revolutions per second.
•10% - Draw a blue icosahedron rotating about the z-axis at 2 revolutions per second.
•20% - Implement the virtual trackball camera model described in the book to rotate the scene.
•10% - Documentation.
Either full or zero credit will be given for each of these specifications.
2 What to turn in
Submit all source code, a README file, and a working project file or Makefile which builds an
executable named ’hw5’ or ’hw5.exe’. Turn in a single tarred and gzipped, or zipped file by the start
of class on the due date. Electronic submissions should be made through ecampus.wvu.edu.
1

Partial preview of the text

Download Introduction to Computer Graphics - Assignment | CS 470 and more Assignments Computer Graphics in PDF only on Docsity!

Homework 5 : Due Sept. 26, 2007

CS 470

September 23, 2007

1 Transformations and Parametric Surfaces

The goal of this homework is to gain experience with modeling and viewing transformations and parametric surfaces. The scene to be rendered consists of a parametric surface and several orbiting shapes. The orbiting shapes are to be drawn using glutSolid* functions. The models will continu- ally rotate using time-based animation and glut callback functions. The objects are to move along circular paths with radius = 1. The parametric surface is given by

x = cos(a)(n + sin(b) cos(a/2) −

sin(2b) sin(a/2) 2

y = sin(a)(n + sin(b) cos(a/2) −

sin(2b) sin(a/2) 2

z = sin(a/2) sin(b) +

cos(a/2) sin(2b) 2 for 0 ≤ a ≤ 2 π, 0 ≤ b ≤ 2 π and n = 1.0. Plot the surface by evaluating this equation at points evenly spaced in the a,b domain.

1.1 Specification

Your will create an interactive 3D application with the following features:

  • 10% - Open a 512 × 512 window. The text in the titlebar should read ’Homework 5’. The background color should be black, and the frame buffer should contain a depth buffer for hidden surface removal. Render your name in the lower left hand corner. Create a perspective viewing volume sized so that everything is clearly visible and undistorted, and the surface is in the center of the screen.
  • 10% - Render the surface using points. Select this mode using function key F1.
  • 10% - Render the surface using lines. Select this mode using function key F2.
  • 10% - Render the surface using triangles. Select this mode using function key F3.
  • 10% - Draw a red dodecahedron rotating about the x-axis at 1 revolution per second.
  • 10% - Draw a green octohedron rotating about the y-axis at 1.5 revolutions per second.
  • 10% - Draw a blue icosahedron rotating about the z-axis at 2 revolutions per second.
  • 20% - Implement the virtual trackball camera model described in the book to rotate the scene.
  • 10% - Documentation. Either full or zero credit will be given for each of these specifications.

2 What to turn in

Submit all source code, a README file, and a working project file or Makefile which builds an executable named ’hw5’ or ’hw5.exe’. Turn in a single tarred and gzipped, or zipped file by the start of class on the due date. Electronic submissions should be made through ecampus.wvu.edu.