POV-Ray : Newsgroups : povray.binaries.images : Stupid Beginner's Media Problem Server Time
14 Nov 2024 04:30:29 EST (-0500)
  Stupid Beginner's Media Problem (Message 1 to 4 of 4)  
From: Jörg 'Yadgar' Bleimann
Subject: Stupid Beginner's Media Problem
Date: 11 Nov 2009 19:02:18
Message: <4afb508a$1@news.povray.org>
High!

After Christoph's suggestion to use media for my Saturn's rings, I 
started working through the Media Tutorial in the POV manual to get a 
thorough understanding of what's media all about... but already at the 
first simple demo scene, I ran into an impossibility:

Why gives

sphere // transparent sphere containing media
  { <0, 2, 0>,1
    pigment { rgbt 1 }
    hollow
    interior
    { media
      { emission 1
        density
        { spherical density_map
          { [0 rgb 0]
            [0.4 rgb <1,0,0>]
            [0.8 rgb <1,1,0>]
            [1 rgb 1]
          }
        }
      }
   }
}

which I literally copied from the tutorial (except for the position of 
the sphere's center), no visible media at all? Yes, I noticed that 
emitting media is best visible against dark backgrounds, so I set the 
ground plane to rgb 0.2 - but all I ever get is an empty grey plane 
beneath an empty black sky!

When I lower the sphere's pigment's rgbt level, the sphere becomes 
visible (therefore, no wrong camera orientation), but still with no 
visible media inside...

See you in Khyberspace!

Yadgar


Post a reply to this message

From: clipka
Subject: Re: Stupid Beginner's Media Problem
Date: 11 Nov 2009 19:32:28
Message: <4afb579c$1@news.povray.org>


> sphere // transparent sphere containing media
>  { <0, 2, 0>,1
>    pigment { rgbt 1 }
>    hollow
>    interior
>    { media
>      { emission 1
>        density
>        { spherical density_map
>          { [0 rgb 0]
>            [0.4 rgb <1,0,0>]
>            [0.8 rgb <1,1,0>]
>            [1 rgb 1]
>          }
>        }
>      }
>   }
> }
> 
> which I literally copied from the tutorial (except for the position of 
> the sphere's center), no visible media at all? Yes, I noticed that 
> emitting media is best visible against dark backgrounds, so I set the 
> ground plane to rgb 0.2 - but all I ever get is an empty grey plane 
> beneath an empty black sky!

You forgot to move the pattern with the object. If you instead crate the 
sphere at the center, and just translate it around once you've equipped 
it with the media, you should be fine.

Likewise, if you substituted "onion" for "spherical", you'd have gotten 
some visible stuff, too (but again most likely not what you want).


Post a reply to this message

From: Warp
Subject: Re: Stupid Beginner's Media Problem
Date: 12 Nov 2009 13:39:34
Message: <4afc5666$1@news.povray.org>

> sphere // transparent sphere containing media
>  { <0, 2, 0>,1
>    pigment { rgbt 1 }
>    hollow
>    interior
>    { media
>      { emission 1
>        density
>        { spherical density_map
>          { [0 rgb 0]
>            [0.4 rgb <1,0,0>]
>            [0.8 rgb <1,1,0>]
>            [1 rgb 1]
>          }
>        }
>      }
>   }
> }

  Your sphere is centered at <0, 2, 0>, while your spherical density map
is centered at <0, 0, 0>. Thus it's not a surprise that you are not
seeing anything because inside the sphere the density is rgb 0 all over.

  Create the sphere centered at <0, 0, 0> and then translate it to
<0, 2, 0> at the end (ie. after the interior definition).


Post a reply to this message

From: Alain
Subject: Re: Stupid Beginner's Media Problem
Date: 12 Nov 2009 16:11:43
Message: <4afc7a0f$1@news.povray.org>

> High!
> 
> After Christoph's suggestion to use media for my Saturn's rings, I 
> started working through the Media Tutorial in the POV manual to get a 
> thorough understanding of what's media all about... but already at the 
> first simple demo scene, I ran into an impossibility:
> 
> Why gives
> 
> sphere // transparent sphere containing media
>  { <0, 2, 0>,1
>    pigment { rgbt 1 }
>    hollow
>    interior
>    { media
>      { emission 1
>        density
>        { spherical density_map
>          { [0 rgb 0]
>            [0.4 rgb <1,0,0>]
>            [0.8 rgb <1,1,0>]
>            [1 rgb 1]
>          }
>        }
>      }
>   }
> }
> 
> which I literally copied from the tutorial (except for the position of 
> the sphere's center), no visible media at all? Yes, I noticed that 
> emitting media is best visible against dark backgrounds, so I set the 
> ground plane to rgb 0.2 - but all I ever get is an empty grey plane 
> beneath an empty black sky!
> 
> When I lower the sphere's pigment's rgbt level, the sphere becomes 
> visible (therefore, no wrong camera orientation), but still with no 
> visible media inside...
> 
> See you in Khyberspace!
> 
> Yadgar

The spherical pattern is centered at <0,0,0> and it density drops to 
zero at a radius of 1 unit.
The result is that the density is zero where you placed your sphere.
If you'd made your sphere larger, it would have had some non-zero media 
inside of it.

The same apply to the boxed, cylindrical and planar patterns. They are 
all defined passing by the origin.

The cure is to create the container around the origin, then to translate 
it to where you want it.

boxed have a density of 1 at the origin, it drops to zero at coordinate 
+1 and -1 on each axis.
cylindrical have a value of 1 ON the Y axis, droping to zero at radius 1 
around it.
planar have a value of 1 on the X-Z plane and drop to zero at +1*y and -1*y.




Alain


Post a reply to this message

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