Description
CS3388 ASSIGNMENT 1
The purpose of this assignment is to complete the Python class graphicsWindow found in file
graphicsWindow.py.
You are asked to program a method drawLine(p1,p2,color) that draws a line
in the image from point p1 to point p2 with color color. The points p1 and p2 are expressed
as tuples (x,y). The color is also a tuple of the form (r,g,b) where r,g,b are values
between 0 and 255.
The method drawLine(p1,p2,color) must:
implement Bresenham’s integer line drawing algorithm correctly, for lines of all
slopes
be properly documented (Header comments: descrpition of parameters, what the
method does, and description of output. Code comments: description of nonobvious sections of code)
The class graphicsWindow is available in the Resources Section of OWL, under Python
Code
Do not change file name nor the actual name of the graphicsWindow class
Make sure your method drawLine(p1,p2,color) is actually called drawLine
Repsect the type and order of the parameters
Use the following Python program to test Drawline(p1,p2,color)
The output of the test program should correspond exactly to this image
Use OWL to submit the file graphicsWindow.py containing your method
drawLine(p1,p2,color)
You must use Python 3.7 and PyCharm 2018.2 or above for this assignment. Before
submitting your assignment, please refer to the assignment marking scheme and
submission guidelines.
CS3388 ASSIGNMENT 2
The purpose of this assignment is to complete a 3D graphics program capable of
displaying parametric objects as wiremesh.
For this purpose, you are required to:
Program the helper methods in class cameraMatrix as exactly specified in the class
notes on this topic.
With the parametric equations provided in the class notes, and inspiring yourself
from provided classes parametricSphere and parametricTorus, implement the following
classes for additional parametric objects (name the classes as specified below):
parametricPlane
parametricCircle
parametricCone
parametricCylinder
Here are some general considerations concerning this assignment:
The sum of the Python code needed for this assignment can be found in OWL under
Resources, Python Code, Assignment 2.
Do not include your code from assignment
1. Use the code that is provided instead.
You must not change provided file names and class names. In addition, exactly
follow the instructions as to the naming of the files and classes you will have to
program for this assignment.
The test program for this assignment is Assign2.py and is found with the rest of the
provided code.
Executing Assign2 should result in an image identical to this one
Use OWL to submit the file myAssignment2.py. This file must contain the following
classes:
cameraMatrix
parametricPlane
parametricCircle
parametricCone
parametricCylinder
You must use Python 3.7 and PyCharm 2018.2 or above for this assignment. Before
submitting your assignment, please refer to the assignment marking scheme and
submission guidelines.
CS3388 ASSIGNMENT 3
The purpose of this assignment is to complete a 3D graphics program capable of
displaying parametric objects as polygonal surfaces.
For this purpose, you are required
to:
Complete the methods in class lightSource. The methods needing completion are the
setter and getter methods.
Complete the constructor and the helper methods in class tessel. This class tessels
the objects of the graphical scence into convex polygons, and computes the color
shade to fill the polygons with. In order to program this properly, refer to the notes
on lighting models (particularly the Section on A Practical Lighting Model), and
the comments included with the provided code tessel.py
If you are starting the assignment before Sunday Feb. 16th at 11:00pm, you will
have to rely on the classes that you have programmed for assignment 2 until its
solution becomes available, which is shortly after its late deadline. It is advised that
you use the solution code of assignment 2 when it comes available.
Here are some general considerations concerning this assignment:
The sum of the Python code needed for this assignment can be found in OWL under
Resources, Python Code, Assignment 3.
You must not change the provided classes that are complete, nor the provided file
names and class names. In addition, exactly follow the instructions as to the
naming of the files and classes you will have to program for this assignment.
The test program for this assignment is Assign3.py and is found with the rest of the
provided code.
Executing Assign3 should result in an image identical to this one
Use OWL to submit the file myAssignment3.py. This file must contain the following
classes:
lightSource
tessel
You must use Python 3.7 and PyCharm 2018.2 or above for this assignment. Before
submitting your assignment, please refer to the assignment marking scheme and
submission guidelines.
CS3388 ASSIGNMENT 4
The purpose of this assignment is to complete a ray tracing program that displays
spheres and computes shadows generated by objects.
For this purpose, you are required
to:
Add a method minimumIntersection to the class cameraMatrix.
For a given ray, this method
finds the t-values of the intersections that the ray makes with the objets in the
scene. It returns the minimum tvalue, along with the object for which this
intersection belongs.
Complete the constructor and the helper method in class shader. For a given ray (and
its corresponding pixel (i,j) in the image) the constructor computes the color for the
pixel (i,j) by applying a shading model identical to that employed in Assignment 3.
The helper method __shadowed determines if a particular pixel in in the shadow of
other objects, or itself. It does so by forming a ray from the intersection point in the
direction of the light source. If any object is intersected by the ray, then the pixel is
in shadowed, and the pixel is shaded using ambient light only.
In order to program this properly, algorithms for the method minimumIntersection, the
class shader constructor, and its helper method __shadowed are provided in this
document.
Here are some general considerations concerning this assignment:
The sum of the Python code needed for this assignment can be found in OWL under
Resources, Python Code, Assignment 4.
You must not change the provided classes that are complete, nor the provided file
names and class names. In addition, exactly follow the instructions as to the
naming of the files and classes you will have to program for this assignment.
The test program for this assignment is Assign4.py and is found with the rest of the
provided code.
Executing Assign4 should result in an image identical to this one
Use OWL to submit the file myAssignment4.py. This file must contain the following
classes:
cameraMatrix
shader
You must use Python 3.7 and PyCharm 2018.2 or above for this assignment. Before
submitting your assignment, please refer to the assignment marking scheme and
submission guidelines.