Submitted by , posted on 05 June 2005



Image Description, by


A recent post on comp.graphics.rendering.raytracing tickled my curiosity, the challenge was to implement a raytracer to render a sphere flake within 100 lines - cough - of C++. This IOTD is what i've come up to after a couple of revisions.

Features:
  • generates a sphere flake and the corresponding hierarchy in place.
  • iterative, that is only the scene generation phase is recursive.
  • simple shading with 1 light and shadows (monochrome PPM output).
  • full scene 2x2 anti-aliasing (rotated grid).
  • decently fast.
  • On 2ghz k8, for a 1024x1024 picture...

    # time ./sphereflake100 8 >pix.ppm
    5380840 spheres,claiming 369.473 MB.

    real 0m7.642s
    user 0m7.329s
    sys 0m0.295s

    More information, source & whatnot here: http://ompf.org/ray/sphereflake/.

    -- tbp.



    [prev]
    Image of the Day Gallery
    www.flipcode.com

    [next]


     


    Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
    Please read our Terms, Conditions, and Privacy information.