How can you get a magnifying glass effect with cycles.

well scaling UV sphere does not give the right shape and will creates a lot of distortion
so i use a parabola to make a real lens shape
now this seems to work a lot better with less distortions

lensrj1.blend (198 KB)

happy cycles

@Swest,I’m not exactly sure.

I’ll do a bit more testing.

@RickyBlender
With the right amount of scaling you can get the right shape.

Whats a Parabola?

salut

Real lenses reverse their images. Try adding another lens.

Thanks,very interesting though a bit hard to understand.

Real lenses reverse their images
depends on the distance for object compare to the focus of the lens

if you move the object further away then the focal lenght then the image becomes reverse!

but also real lens have a parabola shape not a circular one
but it is difficult to see the difference cause the radius is usualy high !

at least now it is working as a real lens

have fun with lens in cycles

As far as I know ‘real’ lenses have a spherical shape, and the reasons for aspherical elements - chromatic aberration and coma - do not exist in Blender because a path tracer cannot refract based on the final color of the sample (which is evaluated AFTER the refraction is done: a bidirectional tracer would show color fringing if I understand how it works, but I digress).
The point I am making is that normal lenses actually are spherical, that is, they have a circular cross section. Lenses to correct vision may be anastigmatic and have more complex cross sections. Catadioptric lenses are based on a different optical principle.
Wikipedia has quite a bit on optical lenses as well as how to combine them to make complex optical devices.

for small lens agree almost circular
problme is that if you scalea UV sphere then you don’t really get a circle it is more like an ellipse
so i use a real parabola instead which when combine with large curvature radius gives almost a circular shape
which i think is more realist

but for large lens like astronomical mirror the shape is closer to a parabola then circular!

happy bl

This is how a magnifying glass works. Try looking through one toward a distant object. It will invert the object. I believe this is called parallax. If you want more magnification you need greater curvature, but keep in mind that you will at the same time be lowering your focal point distance. Try to use 2 objects as lenses like, a telescope does. Google for telescope lenses and then copy their shape and position.

i uploaded file with lenses
use it and make a model then show us what it gives
would be interesting

happy bl

So, don’t scale the UV sphere. Take a slice off the (spherical) top and (spherical) bottom, and build your lens out of that geometry.

problem with that is you still cannot scale it or it will change shape (not circular anymore)!
which is not the case with parabola cause it is symetrical and keep it’s basic shape
so i still prefer the parabola easier to scale and work with

i d like to see in cycles a better way to represent the light color effects
which is supposed to come later on
soon hopefully then we will really see nice effects

happy bl

DruBan is correct - lenses are most usually spherical, unless they are correcting for achromatic or aspheric abberations. When I made the original model I used proportional edit with a spherical falloff to emulate the shape, which is why I was so surprised that the method did not work, yet the one provided by DC did…

Here is Suzanne


Here is Suzanne seen through two lenses


Here is one of the lenses


The lens is a slice of level 4 icosphere. I selected the edge verts after deleting most of the icosphere, scaled them to zero along the y axis to flatten them out, then transformed them to sphere and extruded to get the side of the lens. I then duplicated the shape, rotated one of them 180 degrees and merged them into a single mesh by playing with the remove doubles merge distance parameter.

The camera, the lenses and suzanne are all lined up on one axis. The material is a cycles glass shader, nothing else. The icosphere has a split edge modifier and a level 2 subsurf modifier.

That was fun. :smiley:

(Might have been easier to use an icosphere and a cylinder, and combine them with a boolean modifier… )
Yes, it was easier. It even works with UV spheres, if you rotate the spheres 90 degrees so you don’t get the triangular faces around the poles.)

@Orinoco. The cement you use to glue your lenses together must be of optical quality to avoid excessive noise in Cycles. That was probably your problem in the first one. :evilgrin:

I am not trying to ever reproduce physics experiments so I have found it sufficient to transform>to sphere any fine mesh to make a lens.

one thing that i discovered is that if you set ior glass =0 it does not work!
and if object is big compare to lens size distortion is very high!

the thing is that if it does not have the right shape it will make a lot of distortion!

thanks

Yeah, I found that out when the rubber cement didn’t work… :no:

Still, it was an enjoyable way to spend the afternoon, and taught me some things about cycles and shader nodes in the process, so I feel like I got my money’s worth. And I have a couple more ideas about using the transparent shader and maybe math nodes to produce a lens shape. It might be interesting to produce a lens set up that would exhibit chromatic aberation.

i think i got one somewhere
been done before for lens
but also have some showing colors caustic around too! in another thread for diamonds

salut