POV-Ray : Newsgroups : povray.binaries.images : strange behavior, lightsource + lookslike + media : Re: strange behavior, lightsource + lookslike + media Server Time
30 Jul 2024 12:24:58 EDT (-0400)
  Re: strange behavior, lightsource + lookslike + media  
From: clipka
Date: 29 Oct 2011 08:57:44
Message: <4eabf848$1@news.povray.org>
Am 29.10.2011 14:48, schrieb clipka:
> To be honest, you just discovered a bug in 3.7.RC3 there. Apparently,
> when a light source is translated, the looks_like object is translated
> as well, but not its members (such as media).

The issue can be worked around by creating the light source at the 
target location - as you originally did; but note that a looks_like 
object always needs to be specified as if the light source was at <0,0,0>.

Thus the following code should work with both 3.6.2 and 3.7.0.RC3:


 > #macro Glow(glowPosition, glowRadius, glowColor)
 > light_source
 > {
 >      glowPosition
Leave this line as is.

 >      color rgb glowColor
 >      looks_like
 >      {
 >          sphere
 >          {
 >              glowPosition, glowRadius
Replace this line with:
                <0,0,0>, glowRadius

 >              hollow
 >              pigment
 >              {
 >                  rgbt<0, 0, 0, 1>
 >              }
 >              interior
 >              {
 >                  media
 >                  {
 >                      intervals 1 //  scale this ...
 >                      samples 1, 1
 >                      emission glowColor
 >                      density
 >                      {
 >                          spherical
 >                          scale 3
 >                          density_map
 >                          {
 >                              [0.0 rgb glowColor * 0.000]
 >                              [0.8 rgb glowColor * 0.250]
 >                              [0.9 rgb glowColor * 0.750]
 >                              [1.0 rgb glowColor * 1.000]
 >                          }
 >                      }
 >                      density
 >                      {
 >                          spherical
 >                          density_map
 >                          {
 >                              [0.00 color rgb glowColor * 0.000]
 >                              [ 0.90
 >                                  granite
 >                                  color_map
 >                                  {
 >                                      [0 color rgb glowColor * 0.750]
 >                                      [1 color rgb glowColor * 0.250]
 >                                  }
 >                      //BlackHoleWarp(4, 1, 1, glowPosition, 1)
You'll probably need to replace this line with the following (in case 
you ultimately decide to re-activate it):
                        //BlackHoleWarp(4, 1, 1, <0,0,0>, 1)

 >                              ]
 >                              [1.00 color rgb glowColor * 1.500]
 >                          }
 >                      }
 >                  }
 >              }
 >              finish
 >              {
 >                  reflection 0
 >                  diffuse 0
 >                  ambient 0
 >                  phong 0
 >                  specular 0
 >                  brilliance 0
 >              }
 >          }
 >      }

Do NOT insert a translate here.

 > }
 > #end


Post a reply to this message

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