COMPUTER GRAPHICS  CS 451 

               FALL  2002

 

 


Welcome to CS 451! This page will be used to post all relevant material

for this class, including web references, notes, home-works, midterm

and final specification, etc.

 

Overview:

       For an overview, check the course syllabus.  

Office Hours:

I will be in Room 435 an hour before classes.

      Note: it is always a good idea to send me a brief e-mail a couple of days in advance.

 

 Instructor’s e-mail

 

The TA for this class is Ms. Xiaorong Zhou. Her office hours are:

Wednesday 4:30pm to 6:30pm, ST2 room 365.  Here is TA’s email  

 

To start, here are some interesting links:

 

  Free Lecture Notes on CS

·        http://trident.mcs.kent.edu/~farrell/cg02/lectures/

·        http://www.student.math.uwaterloo.ca/~cs488/lectures.pdf

·        http://www.opengl.org/developers/code/tutorials.html

 

 

Your first task is to set up the OpenGl environment  on your computer.

Dr. Chen’s set of notes will help you out.

 

 

 


          Homeworks  are due within a week since they get posted on this page.

          If you cannot send them on time, you MUST notify me with an e-mail

          the SAME week. Failure to do so will entail an automatic F.

 


           A guideline on how to submit homeworks will be posted here, including

            grades breakpoints.

 

 


          Homeworks are to be sent to TA’s e-mail. Please prefix them with CS451

          (CS451-HW3_Your_Name  in the subject line) so as to ease her job.

         Also, send them in as an attachment, including source code and all necessary

         documentation.

 

 

 

Tuesday, 9/3/20002

 

·        Check out this introductory tutorial to OpenGL.

·        Read Dr. Chen’s second set of notes

·        Read Chapter 1 and 2 from the OpenGL Programming Guide

·        Review the scan-conversion algorithm presented in class

·        Download the C/OpenGL examples from the forthcoming Chen’s book which we used in class

     and play with them (try to change parameters, recompile and see what  happens)

 

 

Tuesday, 9/10/20002

 

·        Review the anti-aliasing algorithm presented in class

·        Write down the general matrix that represent rotation in 2D around an arbitrary point

·        Review the basic 2D linear algebra in Dr. Chen’s  third set of notes

 

Task (due in 2 weeks)

 

Write an OpenGl program that represent a clock.  Pressing the key ‘s’ it will stop, and

pressing ‘ a’ it will resume the handle’s movement.

 

 

Tuesday, 9/17/2002

 

·        Here is the example we looked at in class (go to the bottom of the page and click on 3d

shapes. You can select to download the source code in a variety of environments).

 

Action: add/edit  the transforms in this example (for instance, you could add a scaling),

and try to predict the outcome. If you cannot figure out what happened, no problem:

we can discuss it in class next time.

 

·        Here is a page that contains good commented source code for simple OpenGL tasks;

you can use it as a summary of what we have seen thus far.

 

Action: start studying Chapter 3 of the red book (focus on glRotate, glTranslate and glScale).

Chapter 3 covers some additional material that we are going to analyze in class in the next

 2 lectures

 

 

 


Some student have asked me to be more specific on HW1 requirements. Read on:

 

·        The clock should be a simple circle, on the x y plane (z coordinate=0), but NOT centered at

the origin. It only has one handle.

·        You are allowed to use whichever GL primitives there are (use OpenGL man pages on-line)

·        Add a window resize method, like the ones we have seen in class

·        The clock goes on forever (it pauses and resumes its activity as you press the keys),

unless user exits the program by pressing ESC

·        You can use whatever you like for timer. I would suggest you stick to glut, but if

you are familiar with the windows 32 API or X, please go ahead. However, in the body of your

message to the TA, describe the environment in which you have developed and tested HW1

 

As far as grading goes, F means the program does not even compile. D means the program compiles

but does not do what it is supposed to do. C means OK but sloppy, and possibly missing some features.

B means good work, but not well documented (sorry, but properly documenting your code

IS a requirement: standard C documentation style is in order). A  means very good. TA can assign you

intermediate grades, such a B ½, according to her judgment.  If you are uncertain about what you are supposed to do, please drop me a line and I shall try to answer ASAP.

 

 

Tuesday, 9/24/2002

 

First of all, I apologize for the delay in posting the updated page.

 

The Homework number 2 (“Pinocchio”), will be fully described  in the coming class and will be due

2 weeks afterwards . Meanwhile, your task is to read the section of the red book concerning glLookAt()

and the projection transform (glOrtho(), glFrustrum() and glPerspective().

 

Also take a careful look at the example we have discussed in class (you can download it at

http://www.xmission.com/~nate/tutors.html 

 

 

Tuesday, 10/01/2002

 

Homework number 2 (due by Tuesday 10/15/2002):

 

·        First of all, draw a puppet (“Pinocchio”) at the world coordinates origin.

The puppet consists of a body, legs and arms (all cylinders) , a head (sphere)

and a hat (a cone). You can use glut functions to draw all the parts. Pinocchio

is sitting on a plane parallel to the xz plane, but lower (y coordinate negative). Make sure that

you can see Pinocchio by looking at him from the standard camera position on the z axis

(you have to move the camera backwards to make sure you can see the entire puppet).

 

·        Provide two camera tours of Pinocchio: the first one moves continuously the camera

along the x= 0 meridian, and the second along the y= 0 equator (imagine Pinocchio at the center of the earth)

User must be able to stop the tour and resume it at any time, by pressing the appropriate keys.

Important: the camera must always point to the same spot (say, the heart of Pinocchio) throughout its

trip.

 

·        Extra credit: provide User with the capability of  making a camera tour along any great circle,

            not just the meridian or the equator.

 

    Download the examples we analyzed in class.

 

   Here is an extensive tutorial on projective geometry: it goes far beyond what we discussed in class, but

   you can at least read the first sections (or, if you enjoy the topic, you can spend some time and work your

   way through the entire thing: it is not necessary for this course, but you would add some useful math to

   your arsenal).

 

 

Tuesday, 10/08/2002

 

·        Please take a look at this other tutorial on projective geometry: it is fairly easy going and

     contains a wealth of good material.

 


·        Click here to get to the mid-term page.

 

 

 

Tuesday, 10/29/2002

 

Please read the chapter “Color” from the red GL book. Also, start reading “Lighting”,

up to the sample code.  Review the examples from Nate’s Tutorials on lighting and material.

 


  HW3 (“Gallery”) : the spec for this homework will be given this coming Tuesday in class and

2 days later on this page. HW3 will be due 2 weeks from then (firm).

 

 

Tuesday, 11/05/2002

 


HW3: Gallery. Draw a room (3 walls + floor and ceiling) and a painting on one of the walls (this should

be just a rectangle slightly off the wall, with a picture drawn in it (you can draw any picture you like, but

the default is just a face, i.e. a circle with 2 dots for eyes and a smiling mouth). The room has some

ambient light, so that even without any light source  one can see your painting. Now add a lamp to the scene

(a lamp is just a cone with a light source within. Make sure the light source has the proper CUT_OFF

set: see the red Book). One key controls whether or not the light is on, whereas another pair of keys can

be used to move up or down the lamp  (up means toward the ceiling, down towards the floor). Set the default

position of the lamp so that the light beam hits your picture.

 

If you have any questions, please drop me an e-mail or ask in class. HW3 is due by Tuesday 19.

 

 

 


Results of mid-term.

The average score was : 13.5. 

 4 scores  between 0 and 5      (F)

 9 scores  between 6 and 10    (D)

 9 scores  between  11 and 15 (C)

10 scores between 16 and 20 (B)

 6 scores  between 16 and 20  (A)

 

NOTE: somebody scoring, say, 20, should think of A-. By the same token, 13 is roughly C1/2, and so on.

If there are further questions about your grade, either write to me or we can talk during my office hour.

 

 

Tuesday, 11/19/2002

 


  For HW3 you have time till Sunday 24. Also, if you submitted it once and you intend to resubmit,

 you are allowed to.

 

 

Where we are:  we have covered the section on “Fog” in the red book. Next time we will discuss texturing

and related topics. Please  read the corresponding chapter in the read book so you have a head-start.

 

 

 

  HW4 has been cancelled. Instead, the Project will take its place, becoming a slightly enlarged programming

task. You have time for the project till Sunday December the 7th .

 

 

Here is the spec for the Project (“Pine trees forest”):

 

1)    The scenery is a pine tree forest: the ground should be a texture map (choose a picture of grass or soil from the web). The pine trees are little brown cylinders with a green cone sitting on top

 

2)    Each tree is determined by the following parameters: height, width of the cone, position on the ground.

    All these parameters should be read by the program from some text file. Thus the file contains as many lines

    as the number of trees you want to put in the scene, and each line is made of the 2 coordinates necessary to

    position the  tree, followed by its height & width

 

3)    By pressing the enter key, you should force the program to reread the file and redraw the scene (so if the file has changed, the forest will be different)

 

4)    There should be only a directional light (the sun) in the scene, coming from the sky. Animate this light so that

  it simulates the apparent orbit of the sun throughout a 24 hours day (at night the sun “goes “ under the ground).

The animation runs continuously; if you force rereading the data file, the sun will resume its movement from where it was before.

 

5)    Finally, add a whitish fog to the scene (use EXP mode). A pair of keys controls the density of the fog , so

you can make it thicker or lighter

 

Extra credits: change the material of the tree based on some info in the file (example, the diffuse color of the

leaves). Add a mountain to the horizon (some poly quads with rock texture). Add stars at night (i.e. when the sun goes down).

 

 

Tuesday, 11/19/2002

 


    Here are some pointers for texture mapping in OpenGl:

 

1)    look up again the tutorial and the example we have seen in class. Incidentally, YOU ARE ALLOWED to use

the image loading function for your project. If you have other image formats or you dislike this one, go to

point 3) below.

 

2)    Here is a good tutorial on texture mapping in GL from Microsoft (caveat: if you work on Linux/Unix,

steer away form this one; it uses the standard MS jargon)

 

3)    A good library to read several image files in your GL programs is glBMP. This could be a valid option for your project: if you download the C++ zip file, it comes with a complete example on how to use it.   Recommended.

 

 

  Happy Thanksgiving to everybody! (P.S. I will be reading my mail regularly throughout the weekend: if you have

 questions about the project drop me a line).

 

 


         Click here to go to the Final Page