POV-Ray : Newsgroups : povray.general : Query to Chris Colefax regarding Liquid Spray include. Server Time
7 Aug 2024 19:27:21 EDT (-0400)
  Query to Chris Colefax regarding Liquid Spray include. (Message 1 to 2 of 2)  
From: Ian Jaffray
Subject: Query to Chris Colefax regarding Liquid Spray include.
Date: 11 Aug 2001 11:15:05
Message: <3b754bf9@news.povray.org>
Hi Chris,

I'm making my way through your particle include file and was hoping I could
ask you a few questions regarding using it.

The end goal is a welding sparks animation, so there would be a point
source, with a dozen or so particles proceeding mostly upward and outward at
random shallow angles from that source. I think the particles would need to
be expressed as short lines (cylinders or linear sphere sweeps perhaps) so
there
might be the necessity to have a head and a tail to the particle, both of
which follow the same path under the influence of gravity and which are then
considered as a single object for rendering. Variations in the instantaneous
speed of head and tail particle pairs might create some nice changes in
particle length during their lifetimes (i.e. shorter streaks near the top of
an arc, longer ones as the particles accelerated downwards under gravity).

In the following hopefully stripped-down example, I was trying to send ten
particles straight up from <0,0,0>. They seem, however, to be spiraling in
the +y direction around the reference cylinder (which represents the +y
axis). Admittedly I've just started unravelling your include, but I thought
I had turned off or checked any defaults that might have imparted a rotation
to the creation of the particles. Could you tell me where the rotation is
coming from?

camera {
   location <0, 1, -60>
   look_at <0, 20, 0>
}

light_source {<0, 0, -50> rgb 1}

plane { y, 0
   pigment {color rgb <.2, .5, .8>}
}

cylinder { <0, 0, 0>, <0, 100, 0>, .25
   pigment { White }
}

// SPRAY OPTIONS
#declare spray_loop = true;
#declare particle_dist = 0;
#declare particle_count = 10;
#declare particle_size = 1;
#declare spray_color_map = color_map {
   [0 rgb <1, 1, 1>]
   [1 rgb <1, 1, 1>]
}
#declare particle_life = .5;
#declare spray_strength = 100;
#declare nozzle_angle = 0;
#declare nozzle_spin = 0;
#declare spray_direction = <0, 1, 0>     // DO NOT give this a value of <0,
0, 0> or crash!

#include "Spray.inc"

Also, given my description of the "welding sparks" goal, could I ask you for
any comments on whether your include could be modified to create the
head-tail type of particles I'm hoping to use here? There's an animation
with sparks of the type I'm going for on the www.xl5.com site, under
"Motion", example 4.

Thanks very much for your considerations,

Ian J.


Post a reply to this message

From: Chris Colefax
Subject: Re: Query to Chris Colefax regarding Liquid Spray include.
Date: 14 Aug 2001 09:37:00
Message: <3b79297c@news.povray.org>
"Ian Jaffray" <ija### [at] sympaticoca> wrote:
> I'm making my way through your particle include file and was hoping I
could
> ask you a few questions regarding using it.
>
> The end goal is a welding sparks animation, so there would be a point
> source, with a dozen or so particles proceeding mostly upward and outward
at
> random shallow angles from that source. I think the particles would need
to
> be expressed as short lines (cylinders or linear sphere sweeps perhaps) so
> there
> might be the necessity to have a head and a tail to the particle, both of
> which follow the same path under the influence of gravity and which are
then
> considered as a single object for rendering. Variations in the
instantaneous
> speed of head and tail particle pairs might create some nice changes in
> particle length during their lifetimes (i.e. shorter streaks near the top
of
> an arc, longer ones as the particles accelerated downwards under gravity).
>
> In the following hopefully stripped-down example, I was trying to send ten
> particles straight up from <0,0,0>. They seem, however, to be spiraling in
> the +y direction around the reference cylinder (which represents the +y
> axis). Admittedly I've just started unravelling your include, but I
thought
> I had turned off or checked any defaults that might have imparted a
rotation
> to the creation of the particles. Could you tell me where the rotation is
> coming from?
[snip code]
> Also, given my description of the "welding sparks" goal, could I ask you
for
> any comments on whether your include could be modified to create the
> head-tail type of particles I'm hoping to use here? There's an animation
> with sparks of the type I'm going for on the www.xl5.com site, under
> "Motion", example 4.

Setting the nozzle_spin to 0 should remove any rotation of the particles
about the central axis, and rendering the code you posted this seems to be
the case.  The reason the particle stream is slightly off-centre is that
both your spray_sky and spray_direction are pointing towards +y, and to
avoid calculation problems the include file offsets the spray_direction a
little (which is only noticeable with a nozzle_angle of 0).

To create a stream of sparks as you describe, try this as code as a start:

#declare spray_loop = true;
#declare particle_dist = 0;
#declare particle_count = 100;
#declare particle_size = 2;
#declare particle_stretch = 5;
#declare evaporate = 1;

#declare spray_texture = texture {pigment {rgbt 1}}

#declare particle_life = 5;
#declare spray_strength = 30;
#declare nozzle_angle = 20;
#declare nozzle_spin = 0;
#declare spray_direction = <0, 1, 0>;

#declare spray_turb = .1;
#declare angle_turb = 3;
#declare spin_turb = 10;

object {#include "Spray.inc" hollow
   interior {media {emission rgb <3, 2, 1>}}
   }

This creates transparent particles filled with a bright emission media.
Using evaporate to shrink the particles over time gives the impression of
the sparks cooling and fading.  To give the impression of motion, the
particle_stretch option is used.  Other options would be to try the motion
blurring features of MegaPOV, or to modify the include file itself to create
the particle objects to your exact liking.

Oh, and feel free to ask for further if required...


Post a reply to this message

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