POV-Ray : Newsgroups : povray.general : How to create a transparent (invisible) material with scattering media? : Re: How to create a transparent (invisible) material with scattering media? Server Time
16 Jun 2024 02:12:36 EDT (-0400)
  Re: How to create a transparent (invisible) material with scattering media?  
From: Alain
Date: 26 Mar 2015 19:16:34
Message: <55149352$1@news.povray.org>

> Hi,
>
> I would like to draw laser rays. In my project, they are always in a given
> plane, so I try to add a thin invisible object around this plane, with an
> interior defining scattering. I can visualize the laser rays, and of course, as
> expected, if an object comes in front of it, the ray is stopped by the object.
> But my problem is that I don't find any way for thsi object to be invisible. A
> small piece of code allowing to reproduce my problem is the following. Does
> someone know how I could modify it to make the plane invisible while still
> seeing the rays ?
>

My take:

#include "colors.inc"

global_settings {
     max_trace_level 15
     photons {// I prefer using spacing, but count is OK
         count 100000
         autostop 0
         jitter .4
         //media 100 no longer needed
     }
}

camera {
     perspective
     up < 0 , 0 , 1 >
     right y * image_width / image_height
     location < 0 , -20 , 2.5 >
     look_at < 0 , 0 , 0.8 >
     angle 40 // horizontal FOV angle
}

//background { Quartz }// Not needed

// a laser ray

#declare ray_radius = 0.01 ;
light_source {
     < 100 , 0 , 0.01 > // far to the right
     color rgb 100 * < 1 , 0 , 0 >
     parallel
     point_at < 0 , 0 , 0 > //and going very slightly down
projected_through{cylinder{100*z, -100*z, 0.02}}
// realy a plane of light

}

// A real plane to show the beam
plane{z 0 pigment{rgb 1}
	finish{brilliance 0 ambient 0} // This is the "magic" part !
}

// place the opticaly active objects here

// End of code


This work best when the camera is directly above the plane. It also only 
work when you are realy only working in 2D. If the light need to be 
represented in 3D, then, you realy need to use media.


Alain


Post a reply to this message

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