Creating a ray tracer in scala