POV-Ray : Newsgroups : povray.general : Index of Refraction Question Server Time
29 Jul 2024 18:16:11 EDT (-0400)
  Index of Refraction Question (Message 1 to 9 of 9)  
From: David Miller
Subject: Index of Refraction Question
Date: 13 Jul 2010 19:55:00
Message: <web.4c3cfbab164798c3eb320d530@news.povray.org>
I'm trying to set up a model for a physics experiment I'm doing. The gist of it
is there is a crystal suspended in a liquid over a light source with a camera
above it. I'm trying to set up a povray model where the liquid and the crystal
have different indexes of refraction. The problem is it seems that changing the
index of refraction of the crystal has no effect on the model. IE, if the index
of refraction of both the crystal and the liquid are one, the crystal is still
visible. Any help doing this would be appreciated.

I've pasted my code below. The liquid is the ellipsoid and the crystal is the
box.


light_source {
 < 0, 0, 0>
 rgb <1.000000, 0.999993, 0.999997>
 area_light <1000, 0.0, 0.0>, <0.0, 0.0, 1000>, 5, 5
 photons {
  refraction on
  area_light
 }
 fade_distance 10000
 fade_power 2 //linear
 looks_like{ plane {
    y, -1
    texture {
      pigment {

              color rgb<1, 1, 1>
      }
         }
  }}

}
  camera {
    location  <0, .01, 0>
    look_at   <0, 0, 0>

  }

sphere {
 <0.0, .002, 0.0>, .001
 scale <2, 1, 1>
 scale <1.0, 1.0, 1.0>
 scale <1.0, 1.0, 1.0>
 material {
  texture {
   pigment {
    // Transparency of Ellipsoid
    rgbt <0.000000, 0.981480, 1.000000, .8>
   }
   normal {
    average
    normal_map {
     [ 0.00000 granite]
     [ 1.00000 boxed]
    }
   }
   finish {
   }
  }
  interior {
   //IOR of ellipsoid
   ior 1
  }
 }
 photons {
  target 1.0
  reflection off
  refraction on
  collect on
 }
}
// Box
box {
 < -.0001, 0, -.0001>, < .0001, 0, .0001>
 rotate <0.0, 30, 0.0>
 scale <1.0, 1.0, 1.0>
 scale <1.0, 1.0, 1.0>
 material {
  texture {
   pigment {
    //Transparency of Box
    rgbt <0, 0, 0, .8>
   }
   }
   finish {
   }
  }
  interior {
   //IOR of box
   ior 1
  }
 }
 photons {
  target 1.0
  reflection off
  refraction on
  collect on
 }
}
Thanks


Post a reply to this message

From: Jim Holsenback
Subject: Re: Index of Refraction Question
Date: 14 Jul 2010 06:51:51
Message: <4c3d96c7$1@news.povray.org>
On 07/13/2010 08:50 PM, David Miller wrote:
> I've pasted my code below. The liquid is the ellipsoid and the crystal is the
> box.
> 

you want something other than ior 1.0 ...

http://wiki.povray.org/content/Documentation:Reference_Section_6#Refraction

see the 2nd paragraph

also have a look at consts.inc (distribution include file) there are a
few ior definitions in that file

Jim


Post a reply to this message

From: David Miller
Subject: Re: Index of Refraction Question
Date: 14 Jul 2010 14:50:01
Message: <web.4c3e060fe54b8db5e289b4d90@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:
> On 07/13/2010 08:50 PM, David Miller wrote:
> > I've pasted my code below. The liquid is the ellipsoid and the crystal is the
> > box.
> >
>
> you want something other than ior 1.0 ...
>
> http://wiki.povray.org/content/Documentation:Reference_Section_6#Refraction
>
> see the 2nd paragraph
>
> also have a look at consts.inc (distribution include file) there are a
> few ior definitions in that file
>
> Jim

Thanks for the response. Sorry, my question was not exactly clear. I know that
the ior has to be changed to see refraction. I just copied and pasted the code i
had at that moment and the iors happened to be one. Let me try to rephrase is so
it's obvious what i need.
I want to put a cube (with index of refraction and transmit values to be
determined later) inside an ellipsoid (also with ior and transmit values tbd
later). The problem I'm running into is that once the cube is inside the
ellipse, the two indexes of refraction don't behave how they should. For
example, if the two are the same, the cube should be invisible. Is there someway
to make this work or does pov-ray not like objects inside each other.


Post a reply to this message

From: Jim Holsenback
Subject: Re: Index of Refraction Question
Date: 14 Jul 2010 18:48:03
Message: <4c3e3ea3$1@news.povray.org>
On 07/14/2010 03:46 PM, David Miller wrote:
> Thanks for the response. Sorry, my question was not exactly clear. I know that
> the ior has to be changed to see refraction. I just copied and pasted the code i
> had at that moment and the iors happened to be one. Let me try to rephrase is so
> it's obvious what i need.

Yikes ... code was pretty messy and didn't even pass the parse phase.
examine your camera look_at and location, also closing brace in wrong
place/missing (materials) one or two places.

> I want to put a cube (with index of refraction and transmit values to be
> determined later) inside an ellipsoid (also with ior and transmit values tbd
> later). The problem I'm running into is that once the cube is inside the
> ellipse, the two indexes of refraction don't behave how they should. For
> example, if the two are the same, the cube should be invisible. Is there someway
> to make this work or does pov-ray not like objects inside each other.

After a bit of cleanup, i think the culprit is the rgbt <0,0,0,0.8> that
you had on the box (crystal) ... I changed to rgbt 1, and did a render
with ior 1.33 on ellipse (liquid) and the box with the same ior ...
bingo can't see box, then changed to ior 1.55 for the box and looks ok
fine to me.

I also changed the geometry of the items as you were using VERY VERY
small values, also didn't understand the looks_like you had for the
light source ... is this supposed to be a microscopic view of a crystal
suspended in a drop of water on a slide?

Jim


Post a reply to this message

From: David Miller
Subject: Re: Index of Refraction Question
Date: 14 Jul 2010 19:50:02
Message: <web.4c3e4c5ce54b8db5e289b4d90@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:
> On 07/14/2010 03:46 PM, David Miller wrote:
> > Thanks for the response. Sorry, my question was not exactly clear. I know that
> > the ior has to be changed to see refraction. I just copied and pasted the code i
> > had at that moment and the iors happened to be one. Let me try to rephrase is so
> > it's obvious what i need.

Thanks a ton. That did the trick. I am admittedly just getting started on Povray
so I'm learning the code over a very short period. I realize that it takes a
long time to get any sort of mastery over it. Sorry for the mess. The code was
written in a combination of the povray gui and the megapov gui with a bit added
in by hand...though he original code was at least rendering when I posted it,
maybe I accidently deleted something.
Your pretty much right on. I'm trying to model a protein crystal suspended in
cryogenic liquid over a detector. The looks_like function was supposed to be a
curtain of white light below the crystal.
Thanks again. Your help is really appreciated,
-David


Post a reply to this message

From: clipka
Subject: Re: Index of Refraction Question
Date: 15 Jul 2010 05:18:10
Message: <4c3ed252$1@news.povray.org>
Am 14.07.2010 01:50, schrieb David Miller:
> I'm trying to set up a model for a physics experiment I'm doing. The gist of it
> is there is a crystal suspended in a liquid over a light source with a camera
> above it. I'm trying to set up a povray model where the liquid and the crystal
> have different indexes of refraction. The problem is it seems that changing the
> index of refraction of the crystal has no effect on the model. IE, if the index
> of refraction of both the crystal and the liquid are one, the crystal is still
> visible. Any help doing this would be appreciated.

Why - yes, of course. The crystal has a surface transparency of 0.8, so 
no surprise it's still visible: It does absorb light. Or am I 
misunderstanding something here?


Post a reply to this message

From: Alain
Subject: Re: Index of Refraction Question
Date: 15 Jul 2010 17:23:05
Message: <4c3f7c39$1@news.povray.org>

> I'm trying to set up a model for a physics experiment I'm doing. The gist of it
> is there is a crystal suspended in a liquid over a light source with a camera
> above it. I'm trying to set up a povray model where the liquid and the crystal
> have different indexes of refraction. The problem is it seems that changing the
> index of refraction of the crystal has no effect on the model. IE, if the index
> of refraction of both the crystal and the liquid are one, the crystal is still
> visible. Any help doing this would be appreciated.
>
> I've pasted my code below. The liquid is the ellipsoid and the crystal is the
> box.
>

A few questions:
Why are your dimentions so small?
The camera is at 0.01 unit, the sphere have a 0.001 unit radius, the box 
is only 2/10000 unit whide.

You seems to be working in meters, there is nothing preventing you from 
working in mm or smaller units.


Post a reply to this message

From: David Miller
Subject: Re: Index of Refraction Question
Date: 15 Jul 2010 22:10:01
Message: <web.4c3fbef6e54b8db5c59334e00@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:

> > I'm trying to set up a model for a physics experiment I'm doing. The gist of it
> > is there is a crystal suspended in a liquid over a light source with a camera
> > above it. I'm trying to set up a povray model where the liquid and the crystal
> > have different indexes of refraction. The problem is it seems that changing the
> > index of refraction of the crystal has no effect on the model. IE, if the index
> > of refraction of both the crystal and the liquid are one, the crystal is still
> > visible. Any help doing this would be appreciated.
> >
> > I've pasted my code below. The liquid is the ellipsoid and the crystal is the
> > box.
> >
>
> A few questions:
> Why are your dimentions so small?
> The camera is at 0.01 unit, the sphere have a 0.001 unit radius, the box
> is only 2/10000 unit whide.
>
> You seems to be working in meters, there is nothing preventing you from
> working in mm or smaller units.

I'm probably missing some kind of functionality in Pov-ray but I'm doing it in
order to keep the ellipsoid from refracting the fall off in lighting from the
area_light. Keeping it small and close to the light gives the minimum amount of
distortion. Is there another way to make a light source that illuminates a wider
area? Ideally I'd like an infinitely large (or at least very large in comparison
the the objects) plane of white light below the crystal. In the actual
experiment, the crystal will be many orders of magnitude smaller then the light
source.
Thanks again for everyone's help


Post a reply to this message

From: Alain
Subject: Re: Index of Refraction Question
Date: 17 Jul 2010 10:55:40
Message: <4c41c46c$1@news.povray.org>

> Alain<aze### [at] qwertyorg>  wrote:

>>> I'm trying to set up a model for a physics experiment I'm doing. The gist of it
>>> is there is a crystal suspended in a liquid over a light source with a camera
>>> above it. I'm trying to set up a povray model where the liquid and the crystal
>>> have different indexes of refraction. The problem is it seems that changing the
>>> index of refraction of the crystal has no effect on the model. IE, if the index
>>> of refraction of both the crystal and the liquid are one, the crystal is still
>>> visible. Any help doing this would be appreciated.
>>>
>>> I've pasted my code below. The liquid is the ellipsoid and the crystal is the
>>> box.
>>>
>>
>> A few questions:
>> Why are your dimentions so small?
>> The camera is at 0.01 unit, the sphere have a 0.001 unit radius, the box
>> is only 2/10000 unit whide.
>>
>> You seems to be working in meters, there is nothing preventing you from
>> working in mm or smaller units.
>
> I'm probably missing some kind of functionality in Pov-ray but I'm doing it in
> order to keep the ellipsoid from refracting the fall off in lighting from the
> area_light. Keeping it small and close to the light gives the minimum amount of
> distortion. Is there another way to make a light source that illuminates a wider
> area? Ideally I'd like an infinitely large (or at least very large in comparison
> the the objects) plane of white light below the crystal. In the actual
> experiment, the crystal will be many orders of magnitude smaller then the light
> source.
> Thanks again for everyone's help
>
>
In your case, the actual light_source is probably not needed. You can 
only keep the background plane, or even only use a white background.
Just tested. A white plane and no light looks the same as the light with 
a looks_like plane.

Given that a plane is infinite, you only need to work in an unit system 
that is convenient and place the back plane and the camera as you need them.

You can also use a large box or a whide cylinder. If they are 1000 times 
larger, or more, than the cristal they will act exactly lyke a plane.



Alain


Post a reply to this message

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