POV-Ray : Newsgroups : povray.general : Help needed with 'media' Server Time
5 Nov 2024 05:26:23 EST (-0500)
  Help needed with 'media' (Message 1 to 7 of 7)  
From: Andrew Cocker
Subject: Help needed with 'media'
Date: 30 Nov 1998 14:18:05
Message: <3662ef6d.0@news.povray.org>
Hi,
    Please help me with this annoying problem.
    I have created a union of a sphere ( at origin, radius 1,textured mainly
Red, but with Clear patches), a light_source, (also at origin
media_attenuation on), and a final sphere ( also at origin, radius 2}.
    How do I add media to the larger sphere, so that the shafts of light
coming from within the smaller sphere are visible? I've tried following the
documentation, but the outer sphere is invisible.
    Here's my code ( it's messy, I know).

Thanks in advance.

Andy C.

// ==== Standard POV-Ray Includes ====
#include "colors.inc" // Standard Color definitions
#include "textures.inc" // Standard Texture definitions

camera
{
  location  <0.0 , 4.0 ,-8.0>
  look_at   <0.0 , 0.0 , 0.0>
}

light_source
{
  0*x
  color red 1.0  green 1.0  blue 1.0
  translate <-20, 40, -20>
media_attenuation off
}

union {
sphere {<0,0,0>,1 texture

    pigment

    spotted color_map {
                [0 Red][.6 Red][.61 Clear][.9 Clear][.91 Red][1 Red]}
                }
                scale .2}
}

light_source
{  0*x   color red 1.0  green 1.0  blue 1.0
  translate <0, 0, 0>
media_attenuation on}

// Add media
sphere {<0,0,0>,2 pigment {rgbf<1,1,1,1>}
        interior {
        media {
  intervals 40
  scattering {1, rgb 0.02}
  samples 1, 10
  confidence 0.9999
  variance 1/1000
  ratio 0.9
}
        }
}

}


Post a reply to this message

From: Margus Ramst
Subject: Re: Help needed with 'media'
Date: 1 Dec 1998 05:26:31
Message: <30BC3542.85199F67@peak.edu.ee>
Only hollow objects can contain a media, i.e. you must add the "hollow"
keyword to the larger sphere. Check the manual for info about hollow and
solid objects.

Margus

Andrew Cocker wrote:
> 
> Hi,
>     Please help me with this annoying problem.
>     I have created a union of a sphere ( at origin, radius 1,textured mainly
> Red, but with Clear patches), a light_source, (also at origin
> media_attenuation on), and a final sphere ( also at origin, radius 2}.
>     How do I add media to the larger sphere, so that the shafts of light
> coming from within the smaller sphere are visible? I've tried following the
> documentation, but the outer sphere is invisible.
>     Here's my code ( it's messy, I know).
> 
> Thanks in advance.
> 
> Andy C.
>


Post a reply to this message

From: =Bob
Subject: Re: Help needed with 'media'
Date: 1 Dec 1998 16:39:14
Message: <36646202.0@news.povray.org>
Here's a revamped script:

/* Smoothness factor [1=grainy, 2=rough, 3=default, 4=smooth */

#declare G = 2;

#switch (G)
#case (1)
#declare Granularity = 2;
#break
#case (2)
#declare Granularity = 5;
#break
#case (3)
#declare Granularity = 10;
#break
#case (4)
#declare Granularity = 20;
#break
#end

camera
{
  location  <0.0 , 4.0 ,-8.0>
  look_at   <0.0 , 0.0 , 0.0>
}

light_source { 0*x
  color red 1.0  green 1.0  blue 1.0
  translate <-20, 40, -20>
 media_attenuation off
}

#declare Red=color red 1;
#declare Clear=color rgbf 1;

union {

sphere {<0,0,0>,1
  texture {
    pigment {
     spotted color_map {
            [0 Red][.6 Red][.61 Clear][.9 Clear][.91 Red][1 Red]}
                       }
    scale .2}
     finish {ambient 0 diffuse .5}  //tweaked the sphere
}  //inner sphere

light_source
{  0*x   color rgb<3,2,1> //intense reddish light
  fade_distance 1 fade_power 2  //cause falloff of light
 //neither of these media_ statements are needed unless turning off
// media_attenuation on media_interaction on
}

// Add media
sphere {<0,0,0>,2
  hollow on  //always use this remember (things do not default to this!)
 pigment {rgbf<1,1,1,1>}
   interior {
        media {
        
         absorption <0,.5,1>  //filter out all blue, half green
         
  intervals Granularity  //smoothness of media
  
  samples 5, 10     //fair amount of sampling
  confidence 0.95   //better than default 0.9
  variance 1/150    //better than default 1/128
  ratio 1           //ratio of spotlight lit to unlit region for 
intervals/samples to calculate
  
  scattering {1, rgb .1 extinction 0}  //lower extinction brightens

        }
      }
  } //outer sphere

} //union

Don't know why, but your texture and pigment statements were missing their 
leading braces. Other than that, only real thing wrong was the hollow keyword 
and a need for larger scattering color.

Message <3662ef6d.0@news.povray.org>, Andrew Cocker  typed...
>
>Hi,
>    Please help me with this annoying problem.
>    I have created a union of a sphere ( at origin, radius 1,textured mainly
>Red, but with Clear patches), a light_source, (also at origin
>media_attenuation on), and a final sphere ( also at origin, radius 2}.
>    How do I add media to the larger sphere, so that the shafts of light
>coming from within the smaller sphere are visible? I've tried following the
>documentation, but the outer sphere is invisible.
>    Here's my code ( it's messy, I know).
>
>Thanks in advance.
>
>Andy C.
>
>// ==== Standard POV-Ray Includes ====
>#include "colors.inc" // Standard Color definitions
>#include "textures.inc" // Standard Texture definitions
>
>camera
>{
>  location  <0.0 , 4.0 ,-8.0>
>  look_at   <0.0 , 0.0 , 0.0>
>}
>
>light_source
>{
>  0*x
>  color red 1.0  green 1.0  blue 1.0
>  translate <-20, 40, -20>
>media_attenuation off
>}
>
>union {
>sphere {<0,0,0>,1 texture
>
>    pigment
>
>    spotted color_map {
>                [0 Red][.6 Red][.61 Clear][.9 Clear][.91 Red][1 Red]}
>                }
>                scale .2}
>}
>
>light_source
>{  0*x   color red 1.0  green 1.0  blue 1.0
>  translate <0, 0, 0>
>media_attenuation on}
>
>// Add media
>sphere {<0,0,0>,2 pigment {rgbf<1,1,1,1>}
>        interior {
>        media {
>  intervals 40
>  scattering {1, rgb 0.02}
>  samples 1, 10
>  confidence 0.9999
>  variance 1/1000
>  ratio 0.9
>}
>        }
>}
>
>}
>
>
>
>

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

From: Andrew Cocker
Subject: Re: Help needed with 'media'
Date: 1 Dec 1998 17:55:28
Message: <366473e0.0@news.povray.org>
Thanks Bob and Margus, I've got the hang of it now.

Andy C.


Post a reply to this message

From: Rick van der Meiden
Subject: Re: Help needed with 'media'
Date: 2 Dec 1998 05:36:16
Message: <36651820.0@news.povray.org>
In article <3662ef6d.0@news.povray.org>, and### [at] acockerfreeservecouk 
says...
>
>Hi,
>    Please help me with this annoying problem.
>

... snip....

>    spotted color_map {
>                [0 Red][.6 Red][.61 Clear][.9 Clear][.91 Red][1 Red]}
>                }

It's seems that your problem has been solved allready, but here's another 
(of topic) little hint : To get a abrubt change (of color) in a colormap, or 
any other mapping (texture_map, slope_map, etc) you may replace the above 
piece of code with :

   spotted
   color_map { 
	[0.0 Red]
	[0.6 Red]
	[0.6 Clear]
	[0.9 Clear]
	[0.9 Red]
	[1.0 Red]
   }


assuming you don't want those small bands of smooth transitions.


Hope this helps somewhere,

	Rick.


Post a reply to this message

From: Andrew Cocker
Subject: Re: Help needed with 'media'
Date: 2 Dec 1998 15:33:44
Message: <3665a428.0@news.povray.org>
Thanks Rick. I've been using Pov 2.2 until recently, then I got online and
downloaded 3.1. I'm still trying to adjust, but I'm getting there.


Post a reply to this message

From: =Bob
Subject: Re: Help needed with 'media'
Date: 2 Dec 1998 23:22:27
Message: <36661203.0@news.povray.org>
I just happened to realize a slight mistake in a comment added to the example 
scene I posted earlier, shown in part below.
media_interaction is on by default alright; however not so for 
media_attenuation, which is needed for light falloff caused by fogs or 
atmospheric effects, else it defaults to off.

Message <36646202.0@news.povray.org>, =Bob typed...
>
>
>light_source
>{  0*x   color rgb<3,2,1> //intense reddish light
>  fade_distance 1 fade_power 2  //cause falloff of light
> //neither of these media_ statements are needed unless turning off
>// media_attenuation on media_interaction on
>}
>

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/POVring.html
=Bob


Post a reply to this message

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