Smalltalk

Smalltalk ray tracing

October 11, 2003 7:40:36.655

As some of you may know, I wrote a ray tracer many years ago (1986) called DKBTrace.

Ray tracing is a computer graphics technique for rendering images with high realism. See the IRTC web site for some great examples

DKBTrace became the basis of POV-Ray. The original DKBTrace (and even the modern POV-Ray) benefited from some object oriented ideas taken from Smalltalk which I had learned even earlier (1984).

I recently decided to write a very simple Smalltalk raytracer to demonstrate the basic techniques. Even though Smalltalk isn't terribly fast at floating point calculations, this raytracer only runs about 4 times slower than POV-Ray (which isn't bad considering the fact that POV-Ray is heavily optimized in C).

The Smalltalk ray tracer has nowhere near the capabilities of POV-Ray - if you want to do serious raytracing, use POV-Ray. For learning how raytracing works, however, it's a good example.

You can get it from the Cincom public store repository under the bundle "Ray Tracing" or from my web site. If you change the code, let me know what you've done and I'll upload it for others to share.

To try it, run:

RayTrace.RayTraceExamples example1