Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Objective This is a difficult assignment.  You should start on this project far

by | Feb 28, 2022 | Computer and Web Programming : Computer Programming | 0 comments


If you need assistance with writing your essay, our professional Essay Writing Service is here to help!


This is a difficult assignment.  You should start on this project far before of the due date, to give yourself time to write and debug your code.
The goal of this project is to write a ray tracing renderer.  You will write a collection of Javascript functions that, when called, will create a 3D scene and produce 2D images of the scene.  One of the functions will initialize the scene, others will create objects, lights and a virtual camera, and one additional function will cause the scene to be rendered into a 2D image.  You will be provided with various scenes that will call your functions to test your ray tracing code.
This is the first half of a two-part project. For this first part you will cast eye rays into the scene for each pixel, test these rays for intersection with cylinder objects, and then use the diffuse shading equation to find the color for each pixel.  In the second half of the project you will expand your Ray Tracer to include new functionality.
Project Description
You have four primary goals for the first part of this project:
Initialize the scene
Cast eye rays for each pixel
Implement detection of ray intersection with cylinders
Implement the diffuse shading equation
You can accomplish these goals however you see fit. A good approach would be to use object oriented programming practices and create objects for each of the major scene components (light, ray, cylinder). Global lists of scene objects can be stored to allow for easy access. You can then create a Ray object for each pixel and write a method which will take a Ray as input and test it against the scene objects for intersections, returning the closest hit. This Hit object, containing all necessary information, can then be passed to a shading function which would implement the shading equation (for multiple light sources) and return the pixel color. Such an approach would be easy to test and to extend in the next stage of the project.
However you implement the ray tracer, your results should appear exactly like the examples shown below in Results.
Provided Code
The PROVIDED SOURCE CODE  Download PROVIDED SOURCE CODE contains functions that describe various scenes with cylinders. Each number key 1-4 is assigned to a single scene function and pressing that key should reset the scene and create an image of the new one.
You should modify the source code in any way you see fit, and comment your code (include placing your name in the header). The source code is written in Processing/Javascript. Visit “” for more information on built in functions. You are NOT allowed to use most of the built in processing/openGL functions in this project such as for drawing spheres. We are not using rasterization for this project!  You are, however, encouraged to use the p5.Vector data type and the standard math functions.  When in doubt about what library functions are okay to use, please ask the instructor or a TA.
You must set the color of each pixel manually. The easiest way to set a pixel’s color is to create a one-by-one pixel rectangle using the rect() function, as is shown in the provided code.
Scene Description Language
Each scene is described by calling several functions that set up and render the scene.  In addition to the test scenes, we have also provided empty functions for you to write in order to create your ray tracer.  Feel free to define any classes, objects, data structures, and global variables that you want to accomplish this project.
Below are the functions that you will need to implement for this assignment:
Initialize all the data structures and variables so you can start with an empty scene.
set_background (r, g, b)
Sets the background color. If a ray misses all the objects in the scene, the pixel should be given this color.
set_fov (angle)
Specifies the field of view (in degrees) for perspective projection.  You will assume that the eye is at the origin, and that it is looking down the -z axis.
new_light (r, g, b, x, y, z)
Create a point light source at position (x,y,z) and its color (r, g, b). Your code should allow any number of light sources. For the second part of this assignment, you will cause these lights to cast shadows.
new_material  (dr, dg, db, ar, ag, ab, sr, sg, sb, spec_power, k_refl)
Specifies a new surface material with diffuse color (dr, dg, db).  Ignore the other terms for now, since we will not use them until the second part of this assignment.
new_cylinder  (x, y, z, radius, height)
Specifies the creation of a vertical cylinder with its base at (x, y, z) and with a given radius and height.  The material properties of the surface are given by the last new_material() command that was executed prior to this command.
Ray-traces the scene and displays the image in the canvas region in your browser.
Note on color specification: Each of the red, green, and blue components for the above commands are floating point values in the range of 0.0 to 1.0.
Below are the images that your program should generate for a given scene, when you press the keys 1-4.  There will be additional scene descriptions provided for Part B of this project.
My advice: use this github repo for a very similar project to reference functions and essentially copy but for cylinders instead of spheres


Our Services

Top quality papers

We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university, or professional, and we will assign a writer who has a respective degree.

Professional writers

We have hired a team of professionals who provide expert academic help. Most of them are native speakers and PhD holders who are able to take care of any assignment you need help with.


Free Revision

If you feel that we missed something, send the order for a free revision. You will have 10 days to send the order for revision after you receive the final paper. You can either do it on your own after signing in to your personal account or by contacting our support team.

On Time Delivery

All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.

24/7 Support

Our support agents are available 24/7 and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.


We use several checkers to make sure that all papers you receive are plagiarism-free. Our editors carefully go through all sources and in-text citations. We also promise full confidentiality in all our services.


Pediatric Care

Customer satisfaction has always been one of our basic concerns. If you don’t feel satisfied with our delivered work, you can request for a refund.


Authentic Source

We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.


Our confidential essay writing service protects your privacy

We cherish your trust and do our best to protect you. Anything that you share with our private essay writing service is never misused as the access to your personal data is very limited. Your payment details and credit card number also fall under strict protection when you buy a custom essay online from us.

    Meet Our Team

    Wondering who’s working behind the scenes of our professional essay writing service? We have over 700 amazing people on our team including developers, QA engineers, designers, managers, HR specialists, marketers, essay writers, and many more. See who takes care of the orders you place.


    Super writers

    There are 400+ essay writers from all over the world on our team who go through a 3-step hiring process. We call them super-writers because most of them have master’s degrees; therefore, they know the ins and outs of the discipline in which they specialize.



    Our extra-fast and caring support assistants answer your questions 24/7 and resolve any of your troubles. Our team was even nominated for the 2019 Best Quality Management Team Award by the European Contact Centre & Customer Service.

    If you are looking for a reputable and cheapest college essay writing service or homework help websites for college students to write your essay for you or do your homework, you are at the right place. We have more than 1000 essay writers who can help you write your essays for you. Just fill the order form above to submit your instructions and get an online essay helper or essay writer who can “write my essay for me”. Once you do, you will be happy that you used our essay services instead of any other online essay writing service.

    Talk To Us

    Need any help? Feel free to Send Us a Note