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

Submitted by Ryan Barnard, posted on March 14, 2003

Image Description, by Ryan Barnard

I wrote my Raytracer in MS Visual C++ 7.0. The only function used to draw something on the screen is SetPixel. There's no OpenGL or DirectX performing the calculations...all algorithms were coded into the program, which then would read in the scene description (sample in the upper-left picture). The program crunched on the scene description for a while (sometimes a very long while) and would finally spit out the image. The image is also converted into a DIB section in case the user wishes to export the graphic to a file.

This program was written to learn:
  • Antialiasing
  • Reflection
  • Shadowing
  • Ambient, diffuse, and Phong illumination with point light sources
  • String parsing (just on the side, for fun)
  • Included are three sample images the raytracer can produce (currently it can only draw spheres, cubes, and cylinders). The top image is 4 spheres inside a very large cube with reflections cranked up really high. This image, with 2x AA, 10-deep reflections, at 1600x1200 resolution took just a couple minutes over 2 hours to render. The middle image was just a fun one to demonstrate different material properties and the Phong (shininess) difference between then. The bottom picture was the first one I did to demonstrate all 3 types of objects interacting, as well as multiple light sources with shadowing and reflection.

    Coming up with the project, I will be adding:
  • 3D Texturing
  • Spotlights
  • And maybe a cel-shaded implementation
  • Let me know how you like it!

    Ryan Barnard

    Image of the Day Gallery


    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.