POV-Ray : Newsgroups : povray.binaries.scene-files : ior.pov Server Time
2 Sep 2024 12:18:44 EDT (-0400)
  ior.pov (Message 1 to 9 of 9)  
From: Josh English
Subject: ior.pov
Date: 22 Jan 2002 11:43:03
Message: <3C4D967A.1A0CB16D@spiritone.com>
This file shows the path of light as it passes through mediums with
different index of refractions. There are three lenses that I've written
into the file, and the variables mu1 and mu2 are the index of
refractions for the "open area" and the lens.

Josh English
eng### [at] spiritonecom
http://www.spiritone.com/~english


Post a reply to this message


Attachments:
Download 'us-ascii' (4 KB)

From: Bill DeWitt
Subject: Re: ior.pov
Date: 22 Jan 2002 12:41:27
Message: <3c4da447$1@news.povray.org>
"Josh English" <eng### [at] spiritonecom> wrote

> // Persistence of Vision Ray Tracer Scene Description File
> // File: ?.pov
> // Vers: 3.5
> // Desc: Basic Scene Example
> // Date: mm/dd/yy
> // Auth: ?
> //
>
> #version 3.5;
>
> #include "colors.inc"
> #include "math.mcr"

       !!! What is "math.mcr"???


Post a reply to this message

From: Bill DeWitt
Subject: Re: ior.pov
Date: 22 Jan 2002 15:50:36
Message: <3c4dd09c$1@news.povray.org>
"Bill DeWitt" <bde### [at] cflrrcom> wrote in message
news:3c4da447$1@news.povray.org...
>
> "Josh English" <eng### [at] spiritonecom> wrote
>
> > // Persistence of Vision Ray Tracer Scene Description File
> > // File: ?.pov
> > // Vers: 3.5
> > // Desc: Basic Scene Example
> > // Date: mm/dd/yy
> > // Auth: ?
> > //
> >
> > #version 3.5;
> >
> > #include "colors.inc"
> > #include "math.mcr"
>
>        !!! What is "math.mcr"???

    Ah... math.inc... and a few more changes...

    I'm anxious for the Beta period to be over....


Post a reply to this message

From: Jong
Subject: Re: ior.pov
Date: 24 Mar 2002 21:50:54
Message: <3c9e908e@news.povray.org>
Dear Josh,

 I've been fascinated by your idea of having two IOR values in the lens.
I've also been trying to catch your implemetation of this scene files in the
binaries.images. Well, I could not find it so far. I'll appreciate it if you
could possibly where I could find the image.
One more favor to ask of you:
 I seem to have minor errors when I run your scene file IOR.POV.
Is there  any clues to this?

Thank you again,

Jong
"Josh English" <eng### [at] spiritonecom> wrote in message
news:3C4D967A.1A0CB16D@spiritone.com...
> This file shows the path of light as it passes through mediums with
> different index of refractions. There are three lenses that I've written
> into the file, and the variables mu1 and mu2 are the index of
> refractions for the "open area" and the lens.
>
> Josh English
> eng### [at] spiritonecom
> http://www.spiritone.com/~english


----------------------------------------------------------------------------
----


> // Persistence of Vision Ray Tracer Scene Description File
> // File: ?.pov
> // Vers: 3.5
> // Desc: Basic Scene Example
> // Date: mm/dd/yy
> // Auth: ?
> //
>
> #version 3.5;
>
> #include "colors.inc"
> #include "math.mcr"
>
> global_settings {
>   assumed_gamma 1.0
> }
>
> // ----------------------------------------
>
> camera {
>   location  <-0.0, 7.5, -0.001>
>   direction 1*z
>   right     x*image_width/image_height
>   look_at   <0.0, 0.0,  0.0>
>
> }
>
> sky_sphere {
>   pigment {
>     gradient y
>     color_map {
>       [0.0 rgb <0.6,0.7,1.0>]
>       [0.7 rgb <0.0,0.1,0.8>]
>     }
>   }
> }
>
> light_source {
>   <0, 0, 0>            // light's position (translated below)
>   color rgb <1, 1, 1>  // light's color
>   translate <-30, 30, -30>
> }
>
> // ----------------------------------------
>
> #macro Snell(Vi,N,m1,m2)
>   #local ang = VAng(Vi,N);
>   #if ((ang = 0 ) | (ang = 180))
>      #local t3 = vnormalize(Vi);
>   #else
>     #local uv = vnormalize(vcross(Vi,N));
>     #debug vstr(3,uv," : ",0,1)
>     #local sinr = (m1/m2)*sin(ang);
>     #debug concat ("Angle of incoming ray is " , str(degrees(ang),4,4))
>     #debug concat ("Sine of Refracted ray is " , str(sinr,4,4))
>     #if (abs(sinr) > 1)
>        #debug "Critical Angle?"
>        #local t3 = <0,0,0>;
>     #else
>       #local ang2 = degrees(asin(sinr));
>       #debug concat ("Angle of Refracted ray is " , str(ang2,4,4))
>       #local t3 = vaxis_rotate(vnormalize(-N),uv,ang2);
>       //sphere { t3 0.06 pigment { blue 1 } }
>     #end
>   #end
>   t3
> #end
>
> plane {
>   y, -1
>   pigment { color rgb <0.7,0.5,0.3> }
> }
>
> // Three different Lens shapes for testing
> #declare Lens0 =
>   box { <-1,-1,-4> <1,1,4>
>         pigment { rgbt <0.5,0.5,1,0.6> }
>         rotate 15*y
>         translate 1*x }
>
> #declare Lens2 =
>   difference {
>   cylinder { <7,-1,0> <7,1,0> 9  }
>   cylinder { <-7,-1.1,0> <-7,1.1,0> 8 }
>   pigment { rgbt <0.5,0.5,1,0.6> }
>   rotate 15*y}
>
>
> #declare Lens1 =
> difference {
>   sphere { <3,0,0> 4 }
>   sphere { <2,0,0> 2.5 }
>   box { <1,-5,-5> <8,5,5> }
>   box { <-2,0.5,-5> <3,5.1,5> }
>   pigment { rgbt <0.5,0.5,1,0.7> } }
>
> #declare Lens = object { Lens0 translate <0,0,0.1> }
>
> object { Lens }
>
> #declare CrownGlass = <1.52,1.526,1.531>;
>
> #declare mu1 = 1; // IOR value for "open area"
> #declare mu2 = 1.9; // IOR value for lens
>
> #declare zp = -2;
> #while (zp < 2 )
>   #declare light_start = <-10,0,zp>;
>   #declare light_direction = <1,0,0>;
>
>   #declare norm = <0,0,0>;
>   #declare p1 = trace(Lens,light_start,light_direction,norm);
>   #declare miss = VNull(norm);
>   #if (miss)
>       #debug "Missed"
>       cylinder { light_start, (light_start + light_direction*10) 0.05
>                  pigment { red 1 } }
>   #else
>       cylinder { light_start, p1 0.05 pigment { rgb 1 } }
>       #declare Refr = Snell(-light_direction,norm,mu1,mu2);
>       #if (VNull(Refr))
>         #debug "Problem"
>       #else
>         #declare norm = <0,0,0>;
>         #declare p2 = trace(Lens,p1,Refr,norm);
>         #declare exit = VNull(norm);
>         #if (exit)
>             #debug "Trapped"
>             cylinder { p1, p1 + Refr * 2 0.05 pigment { red 1 } }
>         #else
>             #declare Refr2 = Snell(-Refr,-norm,mu2,mu1);
>             #if (VNull(Refr2))
>
>             #else
>               cylinder { p1, p2 0.05 pigment { rgb <0,1,0> } }
>               cylinder { p2, p2 + Refr2 * 6, 0.05 pigment { rgb 1 } }
>             #end
>         #end
>       #end
>   #end
>   #declare zp = zp+0.5;
> #end
>


Post a reply to this message

From: Josh English
Subject: Re: ior.pov
Date: 29 Mar 2002 18:36:14
Message: <3CA4F9C6.DD3820D1@spiritone.com>
The scene requires POV-Ray 3.5, I don't know if it will work with
MegaPov, and it won't work with POV-Ray 3.1, since it requires the
trace() function. Also, it calls for "math.mcr" and this might need to
be changed to "math.inc" in your implementaion, like Bill had to do. Let
me know what the errors are and I will try to help.
I didn't post an image using this technique, and I didn't even post an
example image from this file.

Josh English
eng### [at] spiritonecom
http://www.spiritone.com/~english


Jong wrote:
> 
> Dear Josh,
> 
>  I've been fascinated by your idea of having two IOR values in the lens.
> I've also been trying to catch your implemetation of this scene files in the
> binaries.images. Well, I could not find it so far. I'll appreciate it if you
> could possibly where I could find the image.
> One more favor to ask of you:
>  I seem to have minor errors when I run your scene file IOR.POV.
> Is there  any clues to this?
> 
> Thank you again,
> 
> Jong


Post a reply to this message

From: Jong
Subject: Re: ior.pov
Date: 31 Mar 2002 22:45:20
Message: <3ca7d7d0$1@news.povray.org>
Dear Josh,

 I really thank you for your help. This morning, I reinstalled POV-Ray 3.5
version 15. As per your suggestion, the math.mcr was changed to math.inc.
When it was executed, it says
     Parse Error: Cannot assing uninitialized identifier.
at the line(with yellow background)
     #declare miss = VNull(norm);
Since I have not much knowledge about POV programming, I have hard time
finishing the execution.

I'll be more than happy if you could possibly help me with this.

Thank you again,

Jong
"Josh English" <eng### [at] spiritonecom> wrote in message
news:3CA4F9C6.DD3820D1@spiritone.com...
> The scene requires POV-Ray 3.5, I don't know if it will work with
> MegaPov, and it won't work with POV-Ray 3.1, since it requires the
> trace() function. Also, it calls for "math.mcr" and this might need to
> be changed to "math.inc" in your implementaion, like Bill had to do. Let
> me know what the errors are and I will try to help.
> I didn't post an image using this technique, and I didn't even post an
> example image from this file.
>
> Josh English
> eng### [at] spiritonecom
> http://www.spiritone.com/~english
>


Post a reply to this message

From: bob h
Subject: Re: ior.pov
Date: 1 Apr 2002 18:59:18
Message: <3ca8f456@news.povray.org>
"Jong" <jjk### [at] mmewhaackr> wrote in message
news:3ca7d7d0$1@news.povray.org...
> Dear Josh,
>
>  I really thank you for your help. This morning, I reinstalled POV-Ray 3.5
> version 15. As per your suggestion, the math.mcr was changed to math.inc.
> When it was executed, it says
>      Parse Error: Cannot assing uninitialized identifier.
> at the line(with yellow background)
>      #declare miss = VNull(norm);
> Since I have not much knowledge about POV programming, I have hard time
> finishing the execution.
>
> I'll be more than happy if you could possibly help me with this.

I'm not Josh but I think I know what change is needed, just not absolutely
sure.

In the ior.pov file, try changing VNull to VZero and VAng to VAngle. I get a
render but I don't know what to expect. Logic tells me this is probably the
answer though.

bob h


Post a reply to this message

From: Jong
Subject: Re: ior.pov
Date: 2 Apr 2002 05:55:32
Message: <3ca98e24@news.povray.org>
Dear Bob,

 I really appreciate your help. The ior.pov file was changed as per your
suggestions, changing VNull to VZero and VAng to VAngle.
And it worked fine. I've got an image rendered quite quick.

Thank you again.

Jong


"bob h" <omn### [at] charternet> wrote in message
news:3ca8f456@news.povray.org...
> "Jong" <jjk### [at] mmewhaackr> wrote in message
> news:3ca7d7d0$1@news.povray.org...
>
> In the ior.pov file, try changing VNull to VZero and VAng to VAngle. I get
a
> render but I don't know what to expect. Logic tells me this is probably
the
> answer though.
>
> bob h


Post a reply to this message

From: bob h
Subject: Re: ior.pov
Date: 3 Apr 2002 12:16:21
Message: <3cab38e5@news.povray.org>
"Jong" <jjk### [at] mmewhaackr> wrote in message
news:3ca98e24@news.povray.org...
> Dear Bob,
>
>  I really appreciate your help. The ior.pov file was changed as per your
> suggestions, changing VNull to VZero and VAng to VAngle.
> And it worked fine. I've got an image rendered quite quick.
>
> Thank you again.

Glad to have helped, in my usual haphazard sort of way.

bob h


Post a reply to this message

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