Home | Computer Graphics | Adventures in Ray Tracing |     Share This Page

All content Copyright © 2005, P. Lutus. All rights reserved.

Click me for 3D
Click above image for 3D ()

More about lenses
Lenses are a nice addition to a ray tracing scene, so perhaps we should learn a little more about them. As explained previously, lenses cause light to change course by delaying the passage of light wavefronts. This page will show how to choose the right sphere sizes to get a lens of a particular diameter and having a particular focal length.

As it turns out, not by chance, the designers of lenses think of their subject the same way POV-Ray does — by picturing lenses as overlapping spheres, spheres having radii that determine their optical properties. The most basic equation of the lensmaker's art assumes two spheres, with radii r1 and r2 and a particular index of refraction (ior). Armed with these values and a basic equation, we can compute the focal length (fl) of a lens. Here is the equation:

fl =    1
(ior-1) ( 1r1   - 1r2 )

To use this equation, provide the index of refraction and two sphere radii, remembering that in lens computations, radii have signs — for a convex lens with spherical surfaces, one of the two radii is given a negative sign (because one lens surface has positive curvature and one negative).

But, having provided the most basic equation of the lensmaker's art, it occurs to me that most of you would prefer not to perform this kind of computation manually, so here is an easier approach, a calculator built into this page:

Enter desired values:
Focal Length IOR Lens Radius
Results:
Sphere radius Sphere Offset
Example POV-Ray code

This calculator assumes you want to design a symmetrical lens, a lens with both sphere radii the same. To use this calculator, decide what focal length and radius you want your lens to have, type in these values and an index of refraction if the default is not correct, and press "Enter." The calculator will tell you the sphere radii and offsets required to accomplish the result. The offsets are the distances by which the spheres are separated, as shown in the example POV-Ray code window.

I think you will have fun playing with lenses, designing optical systems, seeing what kinds of effects you can achieve. I certainly do — in subsequent pages I will show the step-by-step design of a modern telescope, one that actually works in POV-Ray's virtual world.
 

Home | Computer Graphics | Adventures in Ray Tracing |     Share This Page