POV-Ray : Newsgroups : povray.newusers : Lens Simulation Server Time
1 Nov 2024 21:21:39 EDT (-0400)
  Lens Simulation (Message 1 to 8 of 8)  
From: pelesl
Subject: Lens Simulation
Date: 29 Nov 2004 09:35:01
Message: <web.41ab32dc16f317da555b21880@news.povray.org>
I just started using POVRay recently in a sort-of-scientific manner. I use
it to render streamtraces in measured 3D flows so that I have full control
of how they look (perhaps I'll post a sample at some point).

In any case, I was wondering if anyone has used POVray to simulate optical
systems - that is, draw your lenses using actual glass properties, then
place the camera where a CCD or film plane would be and get a rendered
scene through whatever lens you designed.

If I understand correclty, right now when you define your camera you are in
effect also defining a perfect lens with set field of view. I would like to
define a camera as simply a rendering plane of set size that just gets
whatever rays land on it and images it. That way, I can put the rendering
surface out-of-focus from my lens, simulate extension tubes, etc....

Anyone ever try to do such a thing?

Thanks,
Emilio


Post a reply to this message

From: Warp
Subject: Re: Lens Simulation
Date: 29 Nov 2004 09:50:32
Message: <41ab3738@news.povray.org>
pelesl <pel### [at] itscaltechedu> wrote:
> I would like to
> define a camera as simply a rendering plane of set size that just gets
> whatever rays land on it and images it.

  That would be forward-raytracing (as opposed to backward-raytracing,
which is what POV-Ray does). Not possible.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: ingo
Subject: Re: Lens Simulation
Date: 29 Nov 2004 11:28:04
Message: <Xns95B0B1B21225Aseed7@news.povray.org>
in news:web.41ab32dc16f317da555b21880@news.povray.org pelesl wrote:

> Anyone ever try to do such a thing?
> 

Just have your lenssystem project the photons on a "film"-plane and use 
the camera to render an image of that projection.

Ingo


Post a reply to this message

From: Warp
Subject: Re: Lens Simulation
Date: 29 Nov 2004 16:27:38
Message: <41ab944a@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:
> Just have your lenssystem project the photons on a "film"-plane and use 
> the camera to render an image of that projection.

  Photons do not reflect diffusely from objects and thus what you suggest
is not possible.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: Lens Simulation
Date: 29 Nov 2004 20:44:47
Message: <Xns95B11C3C81D69raf256com@203.29.75.35>
pel### [at] itscaltechedu
news:web.41ab32dc16f317da555b21880@news.povray.org 

> Anyone ever try to do such a thing?

Yeap,
there is actually a very easy way to do that ;)

In opposit to what Piccard..I ment, Warp sad :)

Create a real camera obscure - an hollow box, with a small hole in center.

Hole is actting as object-glass (in fact You should put there some lenses 
to get good result), and on back-wall image is displayed.

But this needs realy high radiosity settings (count >= 1600, use MegaPov 
1.1 plus pre-calculated list of in example 64,000 samples to get good 
quality. I think that recursion_limit should be 2 or even just 1).

Hmm but Im not 100% shure - are radiosity rays effected by IOR of objects 
through with it past?


-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

From: Christopher James Huff
Subject: Re: Lens Simulation
Date: 29 Nov 2004 21:09:07
Message: <cjameshuff-D24A80.21091629112004@news.povray.org>
In article <41ab944a@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> > Just have your lenssystem project the photons on a "film"-plane and use 
> > the camera to render an image of that projection.
> 
>   Photons do not reflect diffusely from objects and thus what you suggest
> is not possible.

Heh...you could put a fine scale normal on all objects and use specular 
reflection. However, this would be obscenely slow.

The best way would be to patch POV to sample the entire lens area for 
each pixel in the image plane. Still slow, but far faster than forward 
raytracing.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Warp
Subject: Re: Lens Simulation
Date: 30 Nov 2004 06:01:38
Message: <41ac5312@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote:
> The best way would be to patch POV to sample the entire lens area for 
> each pixel in the image plane. Still slow, but far faster than forward 
> raytracing.

  I wonder if this would already be possible with POV-Ray's radiosity...
After all, it does exactly that: For each intersection point it shoots
rays to all directions to see what is there... (give or take some sample
reusing, but setting reusing to minimum it just might do the trick).

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: Lens Simulation
Date: 1 Dec 2004 11:58:39
Message: <cjameshuff-36E102.11585101122004@news.povray.org>
In article <41ac5312@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   I wonder if this would already be possible with POV-Ray's radiosity...
> After all, it does exactly that: For each intersection point it shoots
> rays to all directions to see what is there... (give or take some sample
> reusing, but setting reusing to minimum it just might do the trick).

Well, it shoots rays in all directions (well, within a hemisphere), when 
the only ones that matter are the ones that will hit the lens. 
Technically possible (I've done similar things before), but not really a 
better solution than the photons idea.

Hmm...I think you could do it without a patch by rendering a bunch of 
images and messing with the camera to get it to scan the lens area. 
Jitter a skewed orthographic camera around the image plane to sample 
what the lens looks like from different angles, then average the images 
together. It'd be hard to get it right, and the edges would be 
funny...you'd get true depth of field though.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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