DOC PREVIEW
Berkeley COMPSCI 184 - Assignment

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

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, Linux, 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, different libraries, and other factors, so you should verify that your code runs on the instruc-tional 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 person 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.5. 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, use a library like lib-JPEG, or you can use screen shots. Make sure that your web page images demonstrate all the features that you have implemented in your code. CS 184: Foundations of Computer Graphics page 1 of 4Fall 2009Prof. James O’BrienAssignment #3Point Value: 60 pointsDue Date: September 17, 11pm6. 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.There may be up to 5 point lights and 5 directional lights (10 total) in a scene. The r g b val-ues of 1.0 should be mapped to a display values of 255.All command line arguments are optional. The default values should be a black sphere with no lights.CS 184: Foundations of Computer Graphics page 2 of 4Fall 2009Prof. James O’BrienAssignment #3Point Value: 60 pointsDue Date: September 17, 11pmThe coordinate system you use in your program should have the sphere at the origin and the viewer looking down the Z-axis. The X-axis points to the right of the screen, the Y-axis points up, and the viewer is located in the positive Z direction. If this description seems confusing to you, please see the instructor or one of the TAs before the assignment is due.7. Optional features that you can implement for extra credit are:• Anisotropic diffuse or specular shading• Writing the image to a image 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.) The image format must be something commonly supported by most image viewers, for example JPEG, PNG, TIFF, or PPM.• Some sort of "toon" shading.• Other shapes besides spheres.• Multiple 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 as required for the assignment should not be changed. (In other words your enhanced pro-gram must be fully backwards compatible with the original specification.) Your README file should explain what your optional features are and provide example command invocations that produce nice results. Images showing these results should be posted on your web page for the assignment.CS 184: Foundations of Computer Graphics page 3 of 4Fall 2009Prof. James O’BrienAssignment #3Point Value: 60


View Full Document

Berkeley COMPSCI 184 - Assignment

Documents in this Course
Load more
Download Assignment
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 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 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?