POV-Ray : Newsgroups : povray.newusers : Single lens show side view : Re: Single lens show side view Server Time
30 Jun 2024 03:45:08 EDT (-0400)
  Re: Single lens show side view  
From: Arun Kumar
Date: 21 Oct 2011 01:50:01
Message: <web.4ea1072266b8b2e89a5a87d90@news.povray.org>
Thanks again for your help.. It helped me a lot. I have created lens and front &
side views which am exactly looking for. Now i need to calculate the focal
length of the lens. How can i calculate the focal length.

To calculate focal length manually there is a formula
1/f = (n-1) {1/R1 - 1/R2}.

But how can i calculate it from the code.

I need to place the lens exactly at the distance of focal length to get the
better resolution image.

Thanks in advance.

Regards,
Arun.

Le_Forgeron <lef### [at] freefr> wrote:
> Le 07/10/2011 08:19, Arun Kumar a écrit :
> > Thanks for the clarification...
> >
> > I have some more doubts. I created a checker board with stick and a lens. I need
> > to view the stick through the lens. But the lens which i created is in
> > horizontal position. I need to rotate it vertically so that the stick can be
> > viewed through the lens. I tried changing the attributes of ROTATE and TRANSLATE
> > but i couldn't get the exact image which am looking for. Please help me with
> > this issue.
>
> I kept the board without rotation, and moved that rotation on the camera.
> I removed the union (no purpose)
> Adjusted max_trace_level
>
> Beware, the lense currently has 2 layered textures/pigments (and the
> interior... the colour of the material might be too clear to view the
> lense per itself.
>
> #version 3.7;
> #include "colors.inc"
> #include "glass.inc"
> #declare Photons=on;
> #declare Overview=on;
>
>   global_settings { assumed_gamma 1.0
>
> // 20 is for overview=on
> // 3 when off
> max_trace_level 55
>   #if (Photons)
>   photons { spacing 0.02 }
>   #end
> }
>
> #if (Overview)
> camera {
>   //perspective
>   location  <1, 2, -10>
>   look_at   <0, 2,  0>
>   right     x*1.33
>   rotate y*65
>   }
> #else
> camera {
>   //perspective
>   location  <1, 2, -10>
>   look_at   <0, 2,  0>
>   right     x*1.33
>   }
> #end
>
> light_source { <0,15,0> color rgb <1,1,1> }
>
> #declare Glass_material =    // Glass material
> material {
>   texture {
>     pigment {rgbt 1}
>     finish {
>       ambient 0.0
>       diffuse 0.05
>       specular 0.6
>       roughness 0.005
>     }
>   }
>   interior {
>     ior 1.5
>     fade_power 1001
>     fade_distance 0.9
>     fade_color <0.5,0.8,0.6>
>   }
> }
>
>
>
> // floor
> box      { <-4,0,-4>,<4,0,4>    pigment { checker color Black, color
> White} }
> // pole
> cylinder { <0,0,0>,<0,3.5,0>, 0.1   pigment { color MediumSpringGreen } }
>
> // lens
> intersection
> {
>    sphere { <0, 5.5, 0>, 6 }
>    sphere { <0, -5.5, 0>, 6 }
>
>    rotate 90*x
>    translate y*2-3*z
>
> // Beware, layered textures ahead...
>    pigment { color rgbt <0.2, 0.41176, 0.43922, 0.8> }
>    interior { ior 1.5 }
>
>    material { Glass_material }
>
>    photons { target collect off }
> }


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.