Well, I have for a while been curious about modeling how light is effected by lenses with a somewhat realistic computer simulation. My curiosity about chromatic aberrations is what started this nonsense, but I don’t think I will implement code for different wavelengths for a while. It won’t actually create images, but it will trace rays.
It will be in just two dimensions (for now) because lenses can be modeled in 2D. Calculations in 2D are also much cheaper.
I plan on making this a dynamic program where you can move the focal plane, objects, and the lenses around. Eventually, I will set it up so lenses can be moved in an animation or something to demonstrate and experiment with zoom lenses.
Sperical lenses will be the first things that I implement, but I definitely plan on being able to have aspherical lenses as well, represented with NURBS eventually. I really should brush up on my calculus so I can find how rays intersect with these (Newton’s method)… either that, or I could just turn them into line segments and solve a bunch of equations. Either way, I need to learn more math.
I am thinking OpenGL and GLUT for now…. C++, not C because I am an OO whore. I really want to have menus and drag & dropping too, ideally blenderlike, but probably much simpler.
Edit: Wrote a little code and my repository is at:
http://ohpie.com/svn/lens/trunk/