POV-Ray : Newsgroups : povray.newusers : How to create a beam inside a glass? Server Time
1 Nov 2024 15:25:14 EDT (-0400)
  How to create a beam inside a glass? (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Ziyan
Subject: How to create a beam inside a glass?
Date: 21 May 2005 12:05:02
Message: <web.428f5bf3650d078490ff0fdd0@news.povray.org>
The glass has a form of cylinder and the refraction index 1.33(ior 1.33).
How to create a beam inside it?
Thanks.


Post a reply to this message

From: Bob Hughes
Subject: Re: How to create a beam inside a glass?
Date: 21 May 2005 13:36:03
Message: <428f7183$1@news.povray.org>
"Ziyan" <beg### [at] hotmailcom> wrote in message 
news:web.428f5bf3650d078490ff0fdd0@news.povray.org...
> The glass has a form of cylinder and the refraction index 1.33(ior 1.33).
> How to create a beam inside it?

Add 'media' for the light beam to interact with the object. Maybe something 
like the following:

global_settings {
    assumed_gamma 1.0
}

cylinder {
    0, 2*y, 1
    hollow // must be hollow
    pigment {
        rgbt 0.9 // not entirely transparent
    }
    interior {
        ior 1.33
        media {
            scattering {
                1, 1.5 // isotropic type, and amount of scatter
                extinction 0.5 // fades out if >0
            }
        }
    }
}

light_source {
    <1,9,1>, 1
    cylinder // for the "beam" appearance, otherwise use 'spotlight'
    point_at <0,0,0>
    radius 0.1
    falloff 0.2
}

camera {
    location <0,1,-4>
    look_at y
}


Post a reply to this message

From: Ziyan
Subject: Re: How to create a beam inside a glass?
Date: 21 May 2005 19:15:00
Message: <web.428fc0b14282c60c90ff0fdd0@news.povray.org>
Thank you very much.

Then how could I create a beam through a piece glass? I mean the length of
beam langer than that of glass. The beam inside and outside of glass should
be all visible.

Could you help me?


Post a reply to this message

From: Stephen McAvoy
Subject: Re: How to create a beam inside a glass?
Date: 21 May 2005 19:25:27
Message: <0rgv815vd5rlca3bvfdn1nn4t6u0tqvt4h@4ax.com>
On Sat, 21 May 2005 19:13:53 EDT, "Ziyan" <beg### [at] hotmailcom>
wrote:

>Then how could I create a beam through a piece glass? I mean the length of
>beam langer than that of glass. The beam inside and outside of glass should
>be all visible.
>
>Could you help me?
>

Surround the cylinder with a box that has scattering media, use
photons. Look at optics.pov in the sample scenes.



Regards
        Stephen


Post a reply to this message

From: Ziyan
Subject: Re: How to create a beam inside a glass?
Date: 21 May 2005 19:45:00
Message: <web.428fc7304282c60c90ff0fdd0@news.povray.org>
then I created a beam like that

light_source {<0, 0, 68>
    color rgb < 1.2, 1, 1.5>
    cylinder
    point_at <0,0,-68>
    photons {refraction on reflection on}
    translate <-27.5,-0.25,0>
}

cylinder{<0,0,-68>, < 0, 0, 68>,0.5
    hollow
    texture {pigment {color rgbf 1}}
    interior {
        media {
            scattering {1, color Red extinction 0}
            method 3
            intervals 1 samples 4}}
    photons {target}
    translate -27.5*x
}

// to pass through the object

#declare A = merge {object{cylinder {-65*z,65*z,0.4}}

                    object{box {<-0.4,-0.25,-65>,<0.4,0.25,65>}
                           translate 0.25*y  }}
object {A
        translate <-27.5,0,0>

        hollow
        pigment {
        color rgbf 0.7}
        interior {
        ior 1.55
        media {
            scattering {1, 1.5
                extinction 0.5
            }}}}

but nothing happens.....and even a Merge has separated surface.

Stephen McAvoy <mca### [at] aolcom> wrote:
> On Sat, 21 May 2005 19:13:53 EDT, "Ziyan" <beg### [at] hotmailcom>
> wrote:
>
> >Then how could I create a beam through a piece glass? I mean the length of
> >beam langer than that of glass. The beam inside and outside of glass should
> >be all visible.
> >
> >Could you help me?
> >
>
> Surround the cylinder with a box that has scattering media, use
> photons. Look at optics.pov in the sample scenes.
>
>
>
> Regards
>         Stephen


Post a reply to this message

From: Stephen McAvoy
Subject: Re: How to create a beam inside a glass?
Date: 21 May 2005 20:28:52
Message: <rfkv81dbqoermkgpcklfljhkmihtvvh4mb@4ax.com>
On Sat, 21 May 2005 19:41:36 EDT, "Ziyan" <beg### [at] hotmailcom>
wrote:

>but nothing happens.....and even a Merge has separated surface.

/*
I did a quick scene in Moray so look out for different coordinate
system. (Z is up) I hope this helps.

BTW I am not renowned for my textures or media.
*/

default {
  texture {
    pigment { rgb <1,0,0> }
  }
}

#declare Checkered_1 = 
   material  // Checkered_1
   {   
      texture
      {      
         pigment
         {
            checker
               color rgb <0.882353, 0.882353, 0.882353>
               color rgb <0.952941, 0.952941, 0.952941>

         }      
         finish
         {
            ambient 0.1
         }      
         scale  6.0
      }
   }




#declare Scattering = 
   material  // Scattering
   {   
      texture
      {      
         pigment
         {
            color rgbt <0.531233, 0.531233, 0.531233, 1.0>
         }
      }   
      interior
      {
         media  // MyAtmosphere_1_1
         {
            variance 1.0/128.205128
            scattering
            {
               1 ,  rgbt <0.03, 0.03, 0.03, 1.0> // isotropic
scattering
               extinction 0.25
            }
         }
      }
   }




#declare Scattering_1 = 
   material  // Scattering_1
   {   
      texture
      {      
         pigment
         {
            color rgbt <0.0, 0.0, 0.0, 1.0>
         }
      }   
      interior
      {
         ior 1.3
         media  // MyAtmosphere_1_1_1
         {
            variance 1.0/128.205128
            scattering
            {
               1 ,  rgbt <1.0, 1.0, 0.0, 1.0> // isotropic scattering
               extinction 0.25
            }
         }
      }
   }
 
 
global_settings {
  adc_bailout 0.003922
  ambient_light <1.0,1.0,1.0>
  assumed_gamma 1.9
  hf_gray_16 off
  irid_wavelength <0.247059,0.176471,0.137255>
  max_intersections 64
  max_trace_level 10
  number_of_waves 10
  noise_generator 2
  charset ascii
  photons {
    adc_bailout       0.01
    spacing           1.0
    gather            20, 100
    media             0, 1.0
    jitter            0.4
    max_trace_level   5
    autostop          0.5
    radius            0.0
    expand_thresholds 0.2, 35.0
  }
}

background { color <0.000,0.000,0.000> }

camera {  //  Camera Camera01
  location  <      0.059,     -12.191,       4.009>
  sky       <    0.00000,     0.00000,     1.00000> // Use right
handed-system 
  up        <        0.0,         0.0,         1.0> // Where Z is up
  right     <    1.38192,         0.0,         0.0> // Right Vector is
adjusted to compensate for spherical (Moray) vs. planar (POV-Ray)
aspect ratio
  angle         54.40000    // Vertical      40.800
  look_at   <      0.039,      -0.151,       0.036>
}


//
// *******  L I G H T S *******
//

light_source {   // Spotlight Spotlight001
  <0.0, 0.0, 0.0>
  color rgb <0.000, 1.000, 0.000>*10
  spotlight
    point_at  <0.0, 0.0, -2.000>
    falloff    1.268  // outer radius (in deg)
    radius     1.238  // inner radius
    tightness  0.000
  media_attenuation on
  rotate 90.0*y
  translate  7.786407*x
}

light_source {   // Light001
  <0.0, 0.0, 0.0>
  color rgb <1.000, 1.000, 1.000>
  media_interaction off
  photons {
  }
  translate  <0.984692, -14.212549, 19.073553>
}

light_source {   // Spotlight Spotlight002
  <0.0, 0.0, 0.0>
  color rgb <1.000, 0.000, 0.000>*10
  spotlight
    point_at  <0.0, 0.0, -2.000>
    falloff    1.268  // outer radius (in deg)
    radius     1.238  // inner radius
    tightness  0.000
  media_attenuation on
  rotate 50.074482*y
  translate  <4.411019, 0.0, 4.027452>
}





//
// ********  OBJECTS  *******
//

plane { // Plane001
  z,0
  material {
    Checkered_1
  }
  photons {
    target 1.0
  }
  translate  <-0.038357, 0.0, -3.260318>
}


box { // Cube001
  <-1, -1, -1>, <1, 1, 1>
  material {
    Scattering
  }
  hollow
  scale 12.430292
}




cylinder { // Cylndr001
  <0,0,1>, <0,0,0>, 1 
  material {
    Scattering_1
  }
  hollow
  photons {
    reflection on
    refraction on
  }
  scale <1.0, 1.0, 3.723325>
  rotate 90.0*y
  translate  <-1.572624, 0.0, -0.038357>
}








Regards
        Stephen


Post a reply to this message

From: Bob Hughes
Subject: Re: How to create a beam inside a glass?
Date: 21 May 2005 23:53:14
Message: <4290022a$1@news.povray.org>
"Stephen McAvoy" <mca### [at] aolcom> wrote in message 
news:rfkv81dbqoermkgpcklfljhkmihtvvh4mb@4ax.com...
> I did a quick scene in Moray so look out for different coordinate
> system. (Z is up) I hope this helps.
>
> BTW I am not renowned for my textures or media.

Well, Stephen, probably good enough, though, eh? One might say, 'Practice 
makes perfect, but never in POV'.

I tried your example, changed the scattering and extinction so the beams of 
light show up in a much better way.

Don't know why Moray won't keep those decimals trimmed. Guess that's to make 
it read less human. Ha ha. Also, the transmit it has in scattering colors is 
ignored by POV, FAIK, unless anything has changed lately.

I needed to fix a few lines that word wrapped, so hopefully Ziyan has gotten 
around that, if it happened. And just as a side note, I'm using the new beta 
of 3.7 and it doesn't like hf_gray_16 being in there, nor the 
max_intersections. No idea why, ATM, just pointing this out.

So here's those medias (only) for you, Ziyan:

#declare Scattering =
   material  // air or atmosphere
   {
      texture
      {
         pigment
         {
            color rgbt <0.5, 0.5, 0.5, 1.0>
         }
      }
      interior
      {
         media  // MyAtmosphere_1_1
         {
            variance 1.0/128
            scattering
            {
               1 ,  rgb <0.3, 0.3, 0.3> // 10X more now
               extinction 0.1 // less extinction than before
            }
         }
      }
   }

#declare Scattering_1 =
   material  // cylinder object
   {
      texture
      {
         pigment
         {
            color rgbt <0.0, 0.0, 0.0, 1.0>
         }
      }
      interior
      {
         ior 1.3
         media  // MyAtmosphere_1_1_1
         {
            variance 1.0/128
            scattering
            {
               1 ,  rgb <0.5, 0.5, 0.5> // less scatter now
               extinction 0.5 // more extinction here
            }
         }
      }
   }


Post a reply to this message

From: Bob Hughes
Subject: Re: How to create a beam inside a glass?
Date: 22 May 2005 00:35:38
Message: <42900c1a$1@news.povray.org>
When Stephen said surround the cylinder by a box he meant a box that 
surrounds a large part of the scene being rendered, not just around the 
cylinder. Not sure if you understood that, because looking at your script it 
appears that you were only containing the narrow long cylinder and not 
making a *room* with it in which to place the cylinder.

Of course, I'm only speculating on what your trying to make and so maybe you 
*do* want a close-fitting box around the cylinder. Anyway, guess I'm saying 
I can't understand the intent of the scene you're putting together so I 
can't go further with helping about the objects in it.

However, back to media... I should have made it a point to tell you the 
scattering {1,1.5 extinction 0.5} could prove very obscuring when in large 
containers holding it. That 1.5 (or rgb 1.5, which it implies) essentially 
blots out light over a very short distance along the camera line-of-sight. 
It'll take practice to fit the proper values to the scale of the scene, so 
change the scattering color and extinction numbers to whatever appears 
correct for the situation.

Another thing, I noticed you left off radius and falloff (and tightness) in 
the 'cylinder' light source. Unless you want the defaults of radius 0.75, 
falloff 1.0 and tightness 0 (sharpest, brightest edged) then you'll probably 
want to adjust those (I had to look up the defaults so hopefully that is 
still correct).

And, like Stephen said, looking at the sample scene files can really help.

Let us know how you're progressing with the "beam inside glass". Feel free 
to ask more questions.

Bob Hughes


Post a reply to this message

From: Ziyan
Subject: Re: How to create a beam inside a glass?
Date: 22 May 2005 08:40:01
Message: <web.42907cbf4282c60c90ff0fdd0@news.povray.org>
Thank you, Bob and Stephen for all your help. I'm so appreciated when you
could solve my problem as I'm layman and not familiar with POV.

I created an object as following

#declare A = merge {object{cylinder {55*z,65*z,0.4}}
                    object{box {<-0.4,-0.25,55>,<0.4,0.25,65>}
                           translate 0.25*y  }}

#declare B = difference{box {<-0.5,-0.5,55>,<0.5,0.5,65>}
                        object {A}}

A with ior=1.55 and B with ior=1.438

now I want to create a beam through this object to simulate the refraction
and get the beam which comes out from the object.

I utilized all your work and made this, but it seems to be wrong.

global_settings {
  adc_bailout 0.003922
  ambient_light <1.0,1.0,1.0>
  assumed_gamma 1.9
  hf_gray_16 off
  irid_wavelength <0.247059,0.176471,0.137255>
  max_intersections 64
  max_trace_level 10
  number_of_waves 10
  noise_generator 2
  charset ascii
  photons {
    adc_bailout       0.01
    spacing           1.0
    gather            20, 100
    media             0, 1.0
    jitter            0.4
    max_trace_level   5
    autostop          0.5
    radius            0.0
    expand_thresholds 0.2, 35.0
  }
}


//Camera
camera {
         location <0,0,67>
         angle 120
         up 1*y
         right 1.333*x
         look_at <0,0,66>
         translate <-27.5,0,0>
         }

background { color rgb <0, 0, 0> }

//Scattering

#declare Scattering =
   material  // Scattering
   {
      texture
      {
         pigment
         {
            color rgbt <0.531233, 0.531233, 0.531233, 1.0>
         }
      }
      interior
      {
         media  // MyAtmosphere_1_1
         {
            variance 1.0/128.205128
            scattering
            {
               1 ,  rgbt <0.03, 0.03, 0.03, 1.0> // isotropic scattering
               extinction 0.25
            }
         }
      }
   }


#declare Scattering_1 =
   material  // cylinder object
   {
      texture
      {
         pigment
         {
            color rgbt <0.0, 0.0, 0.0, 1.0>
         }
      }
      interior
      {
         ior 1.55
         media  // MyAtmosphere_1_1_1
         {
            variance 1.0/128
            scattering
            {
               1 ,  rgb <0.5, 0.5, 0.5> // less scatter now
               extinction 0.5 // more extinction here
            }
         }
      }
   }


#declare Scattering_2 =
   material  // cylinder object
   {
      texture
      {
         pigment
         {
            color rgbt <0.0, 0.0, 0.0, 1.0>
         }
      }
      interior
      {
         ior 1.438
         media  // MyAtmosphere_1_1_1
         {
            variance 1.0/128
            scattering
            {
               1 ,  rgb <0.5, 0.5, 0.5> // less scatter now
               extinction 0.5 // more extinction here
            }
         }
      }
   }


//Checker

#declare Checkered_1 =
   material  // Checkered_1
   {
      texture
      {
         pigment
         {
            checker
               color rgb <0.882353, 0.882353, 0.882353>
               color rgb <0.952941, 0.952941, 0.952941>

         }
         finish
         {
            ambient 0.1
         }
         scale  6.0
      }
   }


//Lights

light_source {   // Light001
  <0.0, 0.0, 0.0>
  color rgb <1.000, 1.000, 1.000>
  media_interaction off
  photons {
  }
  translate  <2, 2, 0>
}


light_source {<0, 0, 90>
    color rgbt Red*10
    spotlight
    falloff 0.268  // outer radius (in deg)
    radius     0.238
    tightness  0.000
    point_at <0,.5,68>
    photons {refraction on reflection on}
    media_attenuation on
    translate <-27.5,-0.25,0>
}

box{<-5,-5,-80>, < 5, 5, 80>
    material {
    Scattering
  }
  hollow
    translate -27.5*x
}



//Plane
plane { // Plane001
  y,-2
  material {
    Checkered_1
  }
  photons {
    target 1.0
  }

}

//Object

#declare A = merge {object{cylinder {55*z,65*z,0.4}}
                    object{box {<-0.4,-0.25,55>,<0.4,0.25,65>}
                           translate 0.25*y  }}


#declare B = difference{box {<-0.5,-0.5,55>,<0.5,0.5,65>}
                        object {A}}

object {A
        translate <-27.5,0,0>

        material {
    Scattering_1
  }
  hollow
  photons {
    reflection on
    refraction on
  }
        }

object { B
         translate <-27.5,0,0>

         material {
    Scattering_2
  }
  hollow
  photons {
    reflection on
    refraction on
  }
 }

Any ideas?
Thank you again.


Post a reply to this message

From: Ziyan
Subject: Re: How to create a beam inside a glass?
Date: 22 May 2005 08:45:00
Message: <web.42907e494282c60c90ff0fdd0@news.povray.org>
object A has a separated surface between box and semicircle, and B has
neither refraction nor reflection. And ideas?


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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