POV-Ray : Newsgroups : povray.advanced-users : Flowing algorithm? Server Time
1 Nov 2024 17:22:03 EDT (-0400)
  Flowing algorithm? (Message 1 to 6 of 6)  
From: Rune
Subject: Flowing algorithm?
Date: 17 Jun 2001 11:38:21
Message: <3b2cceed@news.povray.org>
Anybody know of a good method to make particles flow along the surface of
any object where 0.0% of the particles fall through the surface? My own
algorithm using trace work pretty well in general but there still are a few
particles escaping here and there...

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated May 10)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Peter Popov
Subject: Re: Flowing algorithm?
Date: 18 Jun 2001 18:08:35
Message: <7assitkg5o9pqmmh2b28r7reo2fki6ldok@4ax.com>
On Sun, 17 Jun 2001 17:35:33 +0200, "Rune"
<run### [at] mobilixnetdk> wrote:

>Anybody know of a good method to make particles flow along the surface of
>any object where 0.0% of the particles fall through the surface? My own
>algorithm using trace work pretty well in general but there still are a few
>particles escaping here and there...

Let's define the height-field as (default orientation):

y = F(x,z) for x,z in [0; 1]

Then we define a force field like this:


G(x,y,z) = | 0, for y > F(x,z)
           | F(x,z) - y, for y <= F(x,z)

for x,z in [0; 1]

Then you can use this force field to repel the particles. If any
particle happens to fall beneath the surface of the height field, it
will be brought back after an iteration or two.

Hope it works :)


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Rune
Subject: Re: Flowing algorithm?
Date: 19 Jun 2001 06:48:11
Message: <3b2f2deb@news.povray.org>
"Peter Popov" wrote:
> Let's define the height-field as (default orientation):
>
> y = F(x,z) for x,z in [0; 1]

Sorry, I should have mentioned that my system is a generic one that is
supposed to work automatically for all POV-Ray objects. That means that
basically the only information I have to work from is what I can get from
the trace function and possible from the object pattern.

> Then we define a force field like this:

I've worked with force fields before and they usually cause me some
problems. One has to make sire the force of the force field is greater than
the sum of all the other forces in the simulation. But if the force field is
too strong is causes the particle to fly up into the air.

> If any particle happens to fall beneath the surface of
> the height field, it will be brought back after an
> iteration or two.

Ah, that's another problem. In the few iterations where the particle is
below the surface it will seem to "disappear". Considering that in a flowing
simulation the particle will be in contact with the surface almost all the
time, the particles will be constantly disappearing and reappearing,
possible causing flickering too.

If you want a bit more information about how my current system works and
what may be the problem, have a look in povray.binaries.animations in the
thread "Flowing Water take 4".

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated May 10)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Peter Popov
Subject: Re: Flowing algorithm?
Date: 19 Jun 2001 10:40:46
Message: <4vouitkmouq6f2u1ahl5svc1guor27s19e@4ax.com>
On Tue, 19 Jun 2001 12:28:08 +0200, "Rune"
<run### [at] mobilixnetdk> wrote:

>"Peter Popov" wrote:
>> Let's define the height-field as (default orientation):
>>
>> y = F(x,z) for x,z in [0; 1]
>
>Sorry, I should have mentioned that my system is a generic one that is
>supposed to work automatically for all POV-Ray objects. That means that
>basically the only information I have to work from is what I can get from
>the trace function and possible from the object pattern.

In any case you can treat a surface as a height field, unless you want
particles to stick to the surface on overhangs (dripping water).

>> Then we define a force field like this:
>
>I've worked with force fields before and they usually cause me some
>problems. One has to make sire the force of the force field is greater than
>the sum of all the other forces in the simulation. But if the force field is
>too strong is causes the particle to fly up into the air.

The only purpose of this force field is to bring back particles that
have fallen into those cracks you mentioned in another post. It can
serve as a backup algorithm. And it will not be too string, as it is a
gradient which starts at the surface of the object and increases
downwards.

This also addresses your other concerns regarding flickering.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Chris Huff
Subject: Re: Flowing algorithm?
Date: 19 Jun 2001 10:58:48
Message: <chrishuff-A8D089.09583919062001@povray.org>
In article <3b2cceed@news.povray.org>,
 "Rune" <run### [at] mobilixnetdk> wrote:

> Anybody know of a good method to make particles flow along the surface of
> any object where 0.0% of the particles fall through the surface? My own
> algorithm using trace work pretty well in general but there still are a few
> particles escaping here and there...

Well, you could just kill any particles that get inside the object...I 
plan to have this as an option for my particle simulation (though it 
will be implemented as "killspaces" which remove any particle that 
enters them).
It would be better to just write your collision algorithm to make sure 
that the particle won't be on the other side of the surface after being 
updated...if you have done this, I don't know what the problem is.

-- 
Christopher James Huff - chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Rune
Subject: Re: Flowing algorithm?
Date: 19 Jun 2001 19:08:15
Message: <3b2fdb5f@news.povray.org>
"Chris Huff" wrote:
> Well, you could just kill any particles that get
> inside the object...

That's what I'm gonna do if nothing else works the way I want. I was going
to add "kill objects" anyway.

> I plan to have this as an option for my particle
> simulation (though it will be implemented as
> "killspaces" which remove any particle that enters
> them).

Same here.

> It would be better to just write your collision
> algorithm to make sure that the particle won't
> be on the other side of the surface after being
> updated...

As far as I know I have done that. And it works in the vast majority of
cases.

> if you have done this, I don't know what the problem is.

Me neither. I'll have to see if I can debug it more effectively.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated May 10)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

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