SingleSphere

SingleSphere - trace_ray public RGBColor trace_ray(Ray ray)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
package raytracer.tracers; import raytracer.utility.*; import raytracer.world.World; public class SingleSphere extends Tracer { // -------------------------------------------------------------------- default constructor public SingleSphere() { super(); } // -------------------------------------------------------------------- constructor public SingleSphere(World world){ super(world); } // --------------------------------------------------------------------
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: trace_ray public RGBColor trace_ray(Ray ray) { ShadeRec sr = new ShadeRec(world_ptr); // not used double t = world_ptr.sphere.hit(ray, sr); // not used if (t > 0) return (RGBColor.red); else return (RGBColor.black); } // -------------------------------------------------------------------- trace_ray public RGBColor trace_ray(Ray ray, int depth) { return (RGBColor.black); } }...
View Full Document

Ask a homework question - tutors are online