[Shootout-list] Ray tracer

Greg Buchholz sleepingsquirrel@yahoo.com
Wed, 27 Apr 2005 14:04:28 -0700 (PDT)


--- Jon Harrop <jon@ffconsultancy.com> wrote:
> 
> I've knocked up a little ray tracer to see if it is feasible to get one
> in the 
> shootout. I think it'll take quite a bit of work to cut it down to be
> small 
> enough. My current attempt (222 LOC in OCaml but with lots of dandy
> features) 

    FWIW, I adapted my previous raytracer to render just the sphereflake
(i.e. removed all the file parsing stuff).   It clocks in at 99
non-comment, non-blank lines of Haskell.  It takes two parameters, a
width and height (in pixels) and spits out a *.ppm file to STDOUT.  No
speed optimizations have been attempted and the ray tracer is pretty
no-frills.  It only handles mirrored spheres and checkered planes.  You
can see the code at...

http://sleepingsquirrel.org/ray_trace/sphereflake.hs

...and an example output at...

http://sleepingsquirrel.org/ray_trace/flake.png


Greg Buchholz




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com