POV-Ray : Newsgroups : povray.newusers : Spark/Electricity : Re: Spark/Electricity Server Time
7 Jul 2024 07:04:20 EDT (-0400)
  Re: Spark/Electricity  
From: Alain
Date: 8 Apr 2010 13:05:42
Message: <4bbe0ce6$1@news.povray.org>

> Hi Guys,
>
> This is my first post so go easy on me. I'm trying to create a scene with a bolt
> of "energy" jumping between two points. Similar to this:
This is the newusers forum after all...
>
> http://runevision.com/3d/include/
>
> The link above is for an electricity.inc file which works with megapov. Despite
> my best efforts I can't get megapov working properly on this machine. It
> grunbles that it can't find files and when I remedy that it grumbles about code
> within the include files.

The main problem, is that electric.inc use "glow" athmospheric effect 
witch is a removed feature that was replaced with media when version 3 
was introduced.
The current version of megapov have been aligned to POV-Ray 3.6 and no 
longer support that discontinued feature.

>
> Does anyone know how I might achieve this or something similar just using
> POVRAY? I have a feeling this is a non-trivial question but I figure if you
> don't ask then you don't get.
>
> Thanks in advance,
>
> Marc
>
>

For that, you need to use emissive media.
Define your "spark" verticaly around the origin with a cylinder of the 
desired lengt.

Make that cylinder hollow and give it texture{rgbt 1} The cylinder is 
now totaly invisible.
Add an interior block to it.

Fill it with emissive media.

Give the media a cylindrical pattern.
The cylindrical pattern have a value of 1 around the Y axis that falls 
to zero at a radius of 1.

Then add a good amount of turbulence.

Lastly, rotate and translate the cylinder to where you want it.
Be sure that you add any rotation and translation only at the end of the 
cylinder's definition. You want to affect the cylinder AND the media.

Sample:

cylinder{10*y, -10*y, 2
// the turbulence will about double the width of the pattern
	pigment{rgbt 1}
	hollow
	interior{media{
		emission 1
		density{cylindrical color_map{[0.1 rgb 0][0.85 rgb<0,0,1>][1 rgb 
10]}turbulence 1}
		samples 30
// need a good sampling due to the turbulence
// DON't change intervals!
			}
		}
	rotate -60*z
	translate 10*z
}

This will give a white chaotic "spark" with a blue outer area that 
twists a lot.
You can render that sample as it is, it use the default camera and don't 
need any light.


Alain


Post a reply to this message

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