Unformatted text preview:

This assignment gets you started doing basic shading calculations. The shading model that you will implement for this assignment is the same one that is implemented in hardware on your graphics card. It is also the basis for more complex shading models and you will use it again in later assignments.1. This assignment should be done alone or in pairs. You may share ideas with other groups, but you may not share code.2. You may develop on Unix, OS X, or Windows. The platform you use will be the one used to grade assignments. Keep in mind that there are slight variations due to OS versions, differ-ent libraries, and other factors, so you should verify that your code runs on the instructional machines appropriate for you platform choice.3. We will be using the submit software for submission of this assignment. Instructions for us-ing the submission software are here. You should include a README file that at the mini-mum contains the following information:• Your (and your partner's) name• The platform your code runs on• The location of your source code (i.e. indicate who in your group has done the submission, and on what platform). Only one of the people in your group should submit the actual code. The other people should only submit the README file.All files needed to compile your code should appear in the submitted directory. It is your re-sponsibility to make sure that they will compile and run properly.• Windows: The grader should be able to recompile your program by simply opening the project and rebuilding it from scratch.• Unix and OS X: The grader should be able to recompile your program simply by typing "make".4. Do not wait until the last minute to start this assignment. This assignment should be easy, but it may not go as smoothly as you would like. Assume the unexpected and give yourself time to deal with it.Check the news group regularly for updates on the assignment or other clarification. We will assume that anything posted there is henceforth known to all.CS 184: Foundations of Computer Graphics page 1 of 3Spring 2008Prof. James O’BrienAssignment #3Point Value: 50 pointsDue Date: Feb 19, 11pm5. Once you have your assignment working, you should also update your class web page to include an “Assignment 3” link to a page with some images generated by your code. If you like, you may write code to output image directly from your software, or you can use screen shots. Make sure that your images demonstrate all the features that you have implemented in your code.6. Program Specification For this assignment, you will write a program that:• Opens a window that contains an OpenGL rendering area.• Displays a circular shape that will be shaded using the Phong Illumination Model for point and directional lights.• The circular shape should occupy most of the window. If the window is resized it should up-date the display so that the shape still occupies most of the window and is still round.• When space bar is pressed the program should exit.You program will take a series of command line options:• -ka r g b This is the ambient color coefficients of the sphere material. The parameters r g b are num-bers between 0 and 1 inclusive.• -kd r g b This is the diffuse color coefficients of the sphere material. The parameters r g b are numbers between 0 and 1 inclusive.• -ks r g b This is the specular color coefficients of the sphere material. The parameters r g b are num-bers between 0 and 1 inclusive.• -sp v This is the power coefficient on the specular term. It is a number between 0 and max_float.• -pl x y z r g bThis adds a point light to the scene. The x y z values are the location of the light. The r g b values are it's color. Note that the x y z values are relative to the sphere. That is, the center of the sphere is at the origin and the radius of the sphere defines one unit of length. The Y direc-tion is UP, the X direction is to the right on the screen, and the Z direction is "in your face." The r g b value are between 0 and max_float, NOT between 0 and 1 (that is, the r g b values en-code the brightness of the light).• -dl x y z r g bThis adds a directional light to the scene. The x y z values are the direction that the light points in. The r g b values are it's color. See -pl for coordinate system notes.CS 184: Foundations of Computer Graphics page 2 of 3Spring 2008Prof. James O’BrienAssignment #3Point Value: 50 pointsDue Date: Feb 19, 11pm7. Optional features that you can implement for extra credit are:• Anisotropic diffuse or specular shading• Writing the image to a JPG file instead of to the screen. (Default would still be to the screen, but an optional command line argument would cause no OpenGL window to be open and file output instead.)• Some sort of "toon" shading.• Other shapes besides spheres.• Multiple spheres that can shadow each other.All features should be clearly documented in your README file. They should be imple-mented through additional command line options. The behavior of the arguments specified in as required for the assignment should not be changed. (In other words your enhanced program must be fully backwards compatible with the original specification.) Your README file should explain what your optional features are and provide example command invoca-tions that produce nice results. Screen shots showing these results should be posted on your web page for the assignment.8. The TAs have provided some example code on the resources page to start with. You may use this code if you like, or you can start from scratch. If you chose to use the TAs' code then you are responsible for figuring out how to use it. If there is a bug in that code, please bring it to the attention of the TAs immediately. Please be advised that even if there is a bug in their code do not assume that you will be allowed to turn in the assignment late.9. This assignment will be graded by looking at your web page to see that you have posted ex-amples demonstrating all required features and by running your code to test it on a specific set of test inputs. At the very minimum, your web page should have:• An image showing diffuse only shading from a single light source• An image showing specular only shading from a single directional light source• An image showing specular only shading from a single


View Full Document

Berkeley COMPSCI 184 - Assignment 3

Documents in this Course
Load more
Download Assignment 3
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Assignment 3 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Assignment 3 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?