I am learning MIT OCW. Today I have finished 6.837 Computer Graphics, Fall 2003 Assignment 1.

The assignment is:

6.837 Introduction to Computer Graphics Assignment 1: Ray Casting Due Wednesday September 17, 2003 at 11:59pm
In this assignment, you will implement a basic ray caster. This will be the basis of all the following assignments, so proper code design is quite important. As seen in class, a ray caster sends a ray for each pixel and intersects it with all the objects in the scene. You will implement a ray caster for an orthographic camera (parallel rays) for sphere primitives. You will use a very basic shading model: the objects have a constant color. As an alternative, you will also display the distance t of each pixel to the camera.
You will use object-oriented design to make your ray-caster flexible and extendable. A generic Object3D class will serve as the parent class for all 3D primitives. You will derive subclasses, such as Sphere, to implement specialized primitives. In later assignments, you will extend the set of primitives with planes and polygons. Similarly, this assignment requires the implementation of a general Camera class and an OrthographicCamera subclass. In the next assignment, you will also derive a general perspective camera.
We provide you with a Ray class and a Hit class to manipulate camera rays and their intersection points.
•Write a pure virtual Object3D class (see specifications below).
•Derive Sphere, a subclass of Object3D, and implement the intersection of a sphere with a ray.
•Derive Group, also a subclass of Object3D, that stores an array of pointers to Object3D instances. Write the intersection routine.
•Write a pure virtual Camera class and subclass OrthographicCamera. Write the corresponding ray generation method for the subclass.
•Use the input file parsing code provided to load the camera, background color and objects of the scene. 1
•Write a main function that reads the scene (using the parsing code provided),
loops over the pixels in the image plane, generates a ray using your OrthographicCamera class, intersects it with the high-level Group that stores the objects of the scene, and writes the color of the closest intersected object.
•Implement a second rendering style to visualize the depth of objects in the scene.
•Extra credit: Write both the geometric and algebraic sphere intersection methods, add cylinders and cones, fog based on distance to the image plane, etc.
•Provide a README.txt file that discusses any problems you encountered, how long it took to complete the assignment, and any extra credit work that you did.

Here is my homework


And here is the output.

depth1 depth2 depth3 depth4 scene1 scene2 scene3 scene4






Fill in your details below or click an icon to log in: 徽标

您正在使用您的 账号评论。 注销 /  更改 )

Facebook photo

您正在使用您的 Facebook 账号评论。 注销 /  更改 )

Connecting to %s

%d 博主赞过: