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


Submitted by Gabriel Gambetta, posted on June 27, 2003




Image Description, by Gabriel Gambetta



Look at the picture. It's a classic raytraced image with reflecting spheres. Not impressed? Let me enumerate the features of the raytracer which rendered it :
  • Sub-pixel accuracy
  • Cast shadows
  • Arbitrary number of spheres
  • Arbitrary number of omnidirectional light sources
  • Reads the scene definition from a text file
  • Produces 24 bit raw images of arbitrary size
  • 100% written in C, without using any external library
  • Still not impressed? What if I told you the complete source code is 1971 bytes long?

    Yes, it's not a typo. One thousand, nine hundred and seventy one bytes of C code. And it could be reduced a little more in expense of "clarity".

    You can download the source code and a demo scene at http://www.mrio-software.com/2k_raytracer.php.

    Gabriel Gambetta


    [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.