Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by tbp, posted on June 05, 2005




Image Description, by tbp



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]

     
    Archive Notice: This content is archived, and commenting is no longer active. It is here for reference purposes. This content was added on an older version of flipcode, before the site closed in 2005.
     
     
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.