POV-Ray : Newsgroups : povray.newusers : Single lens show side view Server Time
27 Jun 2024 16:46:49 EDT (-0400)
  Single lens show side view (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Arun Kumar
Subject: Single lens show side view
Date: 6 Oct 2011 12:50:00
Message: <web.4e8ddbded249915551a4331b0@news.povray.org>
Hello everyone,

I have created a checker board with a pole. Later i designed a single lens (by
intersecting two spheres) to view the pole through the lens. Now i need to see
the side view of the entire image (i.e., Single lens show side view, to
illustrate distance between lens and pole). Please help me with this...
Thanks in advance

Cheers,
Arun.


Post a reply to this message

From: clipka
Subject: Re: Single lens show side view
Date: 6 Oct 2011 13:11:46
Message: <4e8de152$1@news.povray.org>
Am 06.10.2011 18:48, schrieb Arun Kumar:
> Hello everyone,
>
> I have created a checker board with a pole. Later i designed a single lens (by
> intersecting two spheres) to view the pole through the lens. Now i need to see
> the side view of the entire image (i.e., Single lens show side view, to
> illustrate distance between lens and pole). Please help me with this...
> Thanks in advance

Change the camera position accordingly; you may also want to use an 
orthographic camera rather than the standard perspective camera.

To retain the ability to render the image from the current camera 
position, us a construct such as:


   #declare SideView = yes;
   ...

   #if (SideView)
     camera { ... /* side view camera */ }
   #else
     camera { ... /* current camera */ }
   #end


Post a reply to this message

From: Arun Kumar
Subject: Re: Single lens show side view
Date: 7 Oct 2011 02:20:01
Message: <web.4e8e99da66b8b2e851a4331b0@news.povray.org>
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.

Here is my code..


#include "colors.inc"
#include "glass.inc"
#declare Photons=on;

  global_settings {
  assumed_gamma 1.0

  max_trace_level 5
  #if (Photons)
    photons {
      spacing 0.02
    }

  #end
}

camera {
  //perspective
  location  <1, 2, -10>
  look_at   <0, 2,  0>
  right     x*1.33
  }

   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>
  }
}



// CSG union, add all of shapes 1...N

union
     {
     box      { <-4,0,-4>,<4,0,4>    pigment { checker color Black, color White}
rotate -y*35}
     cylinder { <0,0,0>,<0,3.5,0>, 0.1   pigment { color MediumSpringGreen } }

     intersection
        {
     sphere {
      <0, 5.5, 0>, 6
      scale 1
      rotate <0, 0, 0>
      translate <0, 0, 0>

   }

   sphere {
      <0, -5.5, 0>, 6
      scale 1
      rotate <0, 0, 0>
      translate <0, 0, 0>
   }
   translate y*3

   pigment {
      color rgbt <0.2, 0.41176, 0.43922, 0.8>
   }

   interior {
      ior 1.5
   }
   material { Glass_material }

   photons {
      target
      collect off
   }
     }

      }


Thanks,
Arun


Post a reply to this message

From: Le Forgeron
Subject: Re: Single lens show side view
Date: 7 Oct 2011 03:28:40
Message: <4e8eaa28$1@news.povray.org>
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

From: Thomas de Groot
Subject: Re: Single lens show side view
Date: 7 Oct 2011 03:31:46
Message: <4e8eaae2$1@news.povray.org>
On 7-10-2011 8:19, Arun Kumar wrote:
> 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.
>
> Here is my code..
>
>
> #include "colors.inc"
> #include "glass.inc"
> #declare Photons=on;
>
>    global_settings {
>    assumed_gamma 1.0
>
>    max_trace_level 5
>    #if (Photons)
>      photons {
>        spacing 0.02
>      }
>
>    #end
> }
>
> camera {
>    //perspective
>    location<1, 2, -10>
>    look_at<0, 2,  0>
>    right     x*1.33
>    }
>
>     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>
>    }
> }
>
>
>
> // CSG union, add all of shapes 1...N
>
> union
>       {
>       box      {<-4,0,-4>,<4,0,4>     pigment { checker color Black, color White}
> rotate -y*35}
>       cylinder {<0,0,0>,<0,3.5,0>, 0.1   pigment { color MediumSpringGreen } }
>
>       intersection
>          {
>       sphere {
>        <0, 5.5, 0>, 6
>        scale 1
>        rotate<0, 0, 0>
>        translate<0, 0, 0>
>
>     }
>
>     sphere {
>        <0, -5.5, 0>, 6
>        scale 1
>        rotate<0, 0, 0>
>        translate<0, 0, 0>
>     }
>     translate y*3
>
>     pigment {
>        color rgbt<0.2, 0.41176, 0.43922, 0.8>
>     }
>
>     interior {
>        ior 1.5
>     }
>     material { Glass_material }
>
>     photons {
>        target
>        collect off
>     }
>       }
>
>        }
>
>
> Thanks,
> Arun
>
>
>
Change your code for the intersection like this:

intersection {
   sphere {
     <0, 0, 5.5>, 6
     scale 1
     rotate <0, 0, 0>
     translate <0, 0, 0>
   }

   sphere {
     <0, 0, -5.5>, 6
     scale 1
     rotate <0, 0, 0>
     translate <0, 0, 0>
   }
   translate <0, 2, -5>

   pigment {
     color rgbt <0.2, 0.41176, 0.43922, 0.8>
   }

   interior {
     ior 1.5
   }
   material { Glass_material }

   photons {
     target
     collect off
   }
}

Explanation: The intersection (the lens) is now defined in a vertical 
manner by using the z-axis instead of the y-axis. Then, the lens is 
translated 2 units along the y-axis and -5 units along the z-axis, in 
order to see your cylinder at the origin.

NB It does not matter here, but your checkered box has no thickness. Use 
a plane instead or give the box a little thickness like:

<-4, -0.1, -4>,<4, 0, 4>

in order to avoid coincident surfaces.

Thomas


Post a reply to this message

From: Alain
Subject: Re: Single lens show side view
Date: 7 Oct 2011 16:52:32
Message: <4e8f6690@news.povray.org>

> 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.
>
> Here is my code..
>
>
> #include "colors.inc"
> #include "glass.inc"
> #declare Photons=on;
>
>    global_settings {
>    assumed_gamma 1.0
>
>    max_trace_level 5
>    #if (Photons)
>      photons {
>        spacing 0.02
>      }
>
>    #end
> }
>
> camera {
>    //perspective
>    location<1, 2, -10>
>    look_at<0, 2,  0>
>    right     x*1.33
>    }
>
>     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>
>    }
> }
>
>
>
> // CSG union, add all of shapes 1...N
>
> union
>       {
>       box      {<-4,0,-4>,<4,0,4>     pigment { checker color Black, color White}
> rotate -y*35}
>       cylinder {<0,0,0>,<0,3.5,0>, 0.1   pigment { color MediumSpringGreen } }
>
>       intersection
>          {
>       sphere {
>        <0, 5.5, 0>, 6
>        scale 1
>        rotate<0, 0, 0>
>        translate<0, 0, 0>
>
>     }
>
>     sphere {
>        <0, -5.5, 0>, 6
>        scale 1
>        rotate<0, 0, 0>
>        translate<0, 0, 0>
>     }
>     translate y*3
>
>     pigment {
>        color rgbt<0.2, 0.41176, 0.43922, 0.8>
>     }
>
>     interior {
>        ior 1.5
>     }
>     material { Glass_material }
>
>     photons {
>        target
>        collect off
>     }
>       }
>
>        }
>
>
> Thanks,
> Arun
>
>
>

As Thomas pointed out, by changing your working axis, you can create the 
lens verticaly.

Next, if you want to rotate it in any way, you *must* rotate it before 
you do any translate. Otherwise, it will also orbit arount the origin as 
it rotates.
If you want, or need, to scale it, it should also be done before the 
translation, or you'll also scale the previous translation making it 
move further.

I find the lens visible enough as it is, no real need to change it's 
colouration. It may be advisable to use a slightly coloured or textured 
background.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Single lens show side view
Date: 7 Oct 2011 17:55:00
Message: <web.4e8f742366b8b2e878641e0c0@news.povray.org>
"Arun Kumar" <aru### [at] yahoocoin> wrote:
>    photons {
>       target
>       collect off
>    }

You did not ask about photons, but I thought I'd point out that this statement
has no effect in this scene.  You'll need to add "refraction on" to get the
effect of focused light.

Also look into autostop, as an intersection of spheres is often not efficiently
bounded.  (If you don't understand this, then just add "autostop 0" to the
photons block in your global_settings.  It may speed up the photons
calculations.)


Post a reply to this message

From: Arun Kumar
Subject: Re: Single lens show side view
Date: 19 Oct 2011 07:20:01
Message: <web.4e9eb24666b8b2e89a5a87d90@news.povray.org>
Thanks a lot...

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

From: Arun Kumar
Subject: Re: Single lens show side view
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

From: Le Forgeron
Subject: Re: Single lens show side view
Date: 21 Oct 2011 06:45:20
Message: <4ea14d40@news.povray.org>
Le 21/10/2011 07:46, Arun Kumar nous fit lire :
> 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.

The formula is wrong. (or rather, you forgot the interesting part)

it's

1/f = (n-1)( 1/R1 - 1/R2 + (n-1)d/(nR1R2))

(if I was to trust wikipedia :
http://en.wikipedia.org/wiki/Focal_length
)

R1 & R2 are the radius of the sphere.
d is the thickness of the intersection (at the line connecting the spheres)
n is the ior

Numeric application from previous code:
R1=6;
R2=6;
d=1;
n=1.5;
notice that 1/R1-1/R2 is null;

1/f = 0.5 ( 0.5*1/(1.5*6*6)) =
.00462962962962962962962962962962962962962962962962962962

or f= 216

Units (meter, foot, pov-unit) are irrelevant as they all ends up in the
same space (a linear length).


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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