- #1
- 162
- 1
Greetings.
I'm working on a raytracer, and got stuck with trying to model a lens analytically.
Given is a thin lens at position p with the axis n, radius r and a focal distance f, a ray hits it at position p1 going in the direction d.
Which way would the ray be going on the other side of the lens?
The problem is, pretty much all i could google up assumes a rotational symmetry of the lens and talks in terms of an image of an object and similar 2D reduction.
But in 3D the rays mostly hit the lens not in plane with it's axis (the ray vector and lens' normal vector are not coplanar), and for that case i can't find a single mention anywhere.
The closest thing to a solution i can think of is to brute force it - drop the thin lens assumption, determine the glass-to-ray angle, do a refraction, find the intersect on the other side, do another refraction, get the answer.
Is there any simpler way to do this?
I'm working on a raytracer, and got stuck with trying to model a lens analytically.
Given is a thin lens at position p with the axis n, radius r and a focal distance f, a ray hits it at position p1 going in the direction d.
Which way would the ray be going on the other side of the lens?
The problem is, pretty much all i could google up assumes a rotational symmetry of the lens and talks in terms of an image of an object and similar 2D reduction.
But in 3D the rays mostly hit the lens not in plane with it's axis (the ray vector and lens' normal vector are not coplanar), and for that case i can't find a single mention anywhere.
The closest thing to a solution i can think of is to brute force it - drop the thin lens assumption, determine the glass-to-ray angle, do a refraction, find the intersect on the other side, do another refraction, get the answer.
Is there any simpler way to do this?