Difference between revisions of "Sequential Raytracer Assignment"

From CSE231 Wiki
Jump to navigation Jump to search
Line 27: Line 27:
 
==Visualization==
 
==Visualization==
 
{{Viz|RayTracerViz|raytrace.viz|main}}
 
{{Viz|RayTracerViz|raytrace.viz|main}}
 +
 +
Clicking on the SEQUENTIAL button will allow you to see your work.
  
 
[[File:Sequential raytracer viz.png]]
 
[[File:Sequential raytracer viz.png]]

Revision as of 18:11, 8 May 2025

Motivation

We learn the basics of using an instance of RayTraceContext to raytrace (compute the color of each pixel in) a rectangular section. In this case we will draw from (0,0) to (width, height) exclusively.

Code To Investigate

RayTraceContext

public interface RayTraceContext {
	int width();

	int height();

	void mark(int xMin, int yMin, int xMaxExclusive, int yMaxExclusive);

	void rayTrace(int xMin, int yMin, int xMaxExclusive, int yMaxExclusive);
}

Code To Implement

SequentialRayTracer

class: SequentialRayTracer.java Java.png
methods: rayTrace
package: raytrace.group
source folder: student/src/main/java

method: public void rayTrace(RayTraceContext context, Scheduler scheduler) Sequential.svg (sequential implementation only)

Since this is the SequentialRayTracer we will not need to use the scheduler. The rayTrace, width, and height methods on RayTraceContext should be useful here.

Checking Your Solution

Visualization

class: RayTracerViz.java VIZ
package: raytrace.viz
source folder: student/src/main/java

Clicking on the SEQUENTIAL button will allow you to see your work.

Sequential raytracer viz.png

Correctness

class: _SequentialRayTracerTestSuite.java Junit.png
package: raytrace.group
source folder: testing/src/test/java