POV-Ray : Newsgroups : povray.general : QUESTION: How to Emit Light? Server Time
31 Oct 2024 19:24:17 EDT (-0400)
  QUESTION: How to Emit Light? (Message 11 to 11 of 11)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: QUESTION: How to Emit Light?
Date: 2 Dec 2017 18:18:34
Message: <5a2334ca$1@news.povray.org>
Le 17-12-02 à 16:40, Sven Littkowski a écrit :
> On 02.12.2017 14:32, Alain wrote:
>> Remove the interior as it's not needed.
>> Add "no_shadow" to your torus.
>> Place a few lights inside the torus along it's major radius.
>> Make sure that they are fading lights.
> 
> Alain, thanks a lot for your advise.
> I decided, to use radiosity.
> But my question remains, how to create a glow-producing media in or
> around the torus. I started already, but it does not produce the desired
> glow effect.
> 
> ---
> Diese E-Mail wurde von AVG auf Viren geprüft.
> http://www.avg.com
> 

You place a second fully transparent torus with a larger minor radius 
around the main torus. You make that torus hollow and fill it with some 
emissive media.
That media, by default, will have an uniform density.

If you want to have non-uniform density, and as there is no toric 
pattern, you'll need to provide a function to controll the density.

You can use functions.inc and f_torus/f_torus2 as a good start point.
f_torus(x,y,z, Major_Radius, Minor_Radius)
or
f_torus2(x,y,z, Field_Strength, Major_Radius, Minor_Radius)
(the sample scene i_internal.pov show some examples of the uses of those 
functions)

Those evaluate as zero on the minor radius and increase as you get 
farther away.

Sample :
   #declare LCorner = <-1, -0.25, -1>;
   #declare RCorner = <1, 0.25, 1>;
	isosurface {
		function { f_torus(x,y,z, 0.8, 0.2) }
			//P0= major radius
			//P1= minor radius
		contained_by { box { LCorner, RCorner } }
		max_gradient 1
		texture { rgbt 1 }
		hollow
   interior{
     media{emission rgb 1
        density{f_torus(x,y,z, 0.8, 0) }
        }
   rotate -30*x		
	}

When used in a pigment or to controll the density of a media, the minor 
radius set the radius where the entry 0 of a colour_map or density map 
is located.

Here's a small test scene to get you started :
   #version 3.7;
   global_settings{assumed_gamma 1}

   #include "functions.inc"
union{
	torus{1, 0.3 pigment{rgb 0.3}}//Parent
	torus{1, 1	//container
		hollow
   interior{
     media{emission rgb 1
     	samples 20
        density{function{f_torus(x,y,z, 1, 0.3) }
//The major and minor radius must match those of the parent torus
        density_map{[0 rgb<1,0,0>][0.1 rgb 1][0.2 rgb 0.2][0.7 rgb 0]}
        turbulence 0.1}
        }
     }
	}
	pigment{rgbt 1}

	rotate -25*x
	translate 5*z
	}


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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