POV-Ray : Newsgroups : povray.newusers : color_map : Re: color_map Server Time
28 Sep 2024 06:14:00 EDT (-0400)
  Re: color_map  
From: clipka
Date: 22 Aug 2012 07:11:22
Message: <5034be5a$1@news.povray.org>
Am 22.08.2012 04:55, schrieb ltong:

> What I'm trying now is to get some light beams, for example, a focused Gaussian
> laser beam. I first create an object of the shape of a Gaussian beam using
> difference {box, torus} or sth like that. Then I try to create the light effect
> using a color_map inside pigment_interior_media_density, which I learned from
> web. However, i couldn't find any build-in patterns for a Gaussian beam, in
> which the intensity is the highest in the center and attenuates gradually to the
> edges, it has a gradient along the axis as well. Any suggestions for such a
> pattern? Or maybe alternative way to achieve it?

I would suggest trying the function pattern, which (as the name 
suggests) allows you to plug in arbitrary functions.

I guess for a Gaussian beam, the function will be based on the Gauss 
function in some way (don't ask me about details there, I'm not familiar 
with laser beams :-) Wikipedia might know something helpful). The 
gradient along the axis is most likely an exponential falloff:

   // the basic functions for the beam brightness
   #declare FALLOFF  = 0.99; // just an example, toy with it
   #declare FnRadial = function(r) { /* ask Wikipedia */ }
   #declare FnAxial  = function(z) { pow(FALLOFF,z) }

   // helper function to compute radius from x,y
   #declare FnR = function(x,y) { sqrt(x*x+y*y) }

   // the resulting 3D function
   #declare Fn = function(x,y,z) { FnRadial(FnR(x,y)) * FnAxial(z) }


> Also, I still do not understand it quite well. According to what Warp says, it
> is surface of an object that gets colored, so only those x,y,z on the surface
> would be useful to create the color map? Then is it possible to use color_map
> create colors inside a "hollowed" object?

What Warp said applies to the pigment of opqaue objects, but you're 
working with media now, where you'll get the full 3D structure.


Post a reply to this message

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