POV-Ray : Newsgroups : povray.programming : Particles (again...still) Server Time
24 Dec 2024 23:15:43 EST (-0500)
  Particles (again...still) (Message 1 to 7 of 7)  
From: Matt Savard
Subject: Particles (again...still)
Date: 14 Jun 2000 12:12:55
Message: <3947af07@news.povray.org>
Hello all,

I am attempting to make a primitive particle generator in Visual Basic to
create scenes for POV. My math being a bit rusty, I only have it working in
2-D (x and y) I have all the write equations for making a particle travel in
2-D at a certain angle, but what is the formula for the Z direction? For
example, I know to travel at 30 degrees in 2-d, you take the
speed*Sin(angle_in_radians) for x and speed*Cos(angle_in_radians) for y.
What would Z be?

Any help would be, well, helpful! :)

Matt


Post a reply to this message

From: Peter Popov
Subject: Re: Particles (again...still)
Date: 14 Jun 2000 18:21:54
Message: <g01gksg35enoaev88ckuq3in8t1jfbgib5@4ax.com>
On Wed, 14 Jun 2000 09:15:30 -0700, "Matt Savard" <msa### [at] rainorg>
wrote:

>I am attempting to make a primitive particle generator in Visual Basic to
>create scenes for POV. My math being a bit rusty, I only have it working in
>2-D (x and y) I have all the write equations for making a particle travel in
>2-D at a certain angle, but what is the formula for the Z direction? For
>example, I know to travel at 30 degrees in 2-d, you take the
>speed*Sin(angle_in_radians) for x and speed*Cos(angle_in_radians) for y.
>What would Z be?
>
>Any help would be, well, helpful! :)

Just use vector math, it's so much easier.


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


Post a reply to this message

From: Warp
Subject: Re: Particles (again...still)
Date: 15 Jun 2000 05:45:34
Message: <3948a5bd@news.povray.org>
Peter Popov <pet### [at] usanet> wrote:
: Just use vector math, it's so much easier.

  That's right.
  The idea is this: Create a vector which points at the direction you want
to go (it can be, for example, the desired end destination (supposing that
the movement is linear) minus the current location). Then convert it to
a unit vector (vnormalize) and multiply it by the distance you want to
travel along that path. Now just add that vector to the current location.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Warp
Subject: Re: Particles (again...still)
Date: 15 Jun 2000 05:46:31
Message: <3948a5f7@news.povray.org>
(Btw, this algorithm is general; it works in 2D, 3D or any dimension...)

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Matt Savard
Subject: Re: Particles (again...still)
Date: 15 Jun 2000 12:12:45
Message: <3949007d$1@news.povray.org>
I guess my problem is finding out that end destination.

 Matt

Warp <war### [at] tagpovrayorg> wrote in message news:3948a5bd@news.povray.org...
> Peter Popov <pet### [at] usanet> wrote:
> : Just use vector math, it's so much easier.
>
>   That's right.
>   The idea is this: Create a vector which points at the direction you want
> to go (it can be, for example, the desired end destination (supposing that
> the movement is linear) minus the current location). Then convert it to
> a unit vector (vnormalize) and multiply it by the distance you want to
> travel along that path. Now just add that vector to the current location.
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Peter Popov
Subject: Re: Particles (again...still)
Date: 15 Jun 2000 16:22:59
Message: <k6eiks4kqgehmj2g8h1ipvc3neql3e1d5u@4ax.com>
On Thu, 15 Jun 2000 09:15:15 -0700, "Matt Savard" <msa### [at] rainorg>
wrote:

>I guess my problem is finding out that end destination.

LOL I would guess so, yes. A predetermined particle system, now that
wouldn't be fun, would it? :)

You only need a direction. When two spherical particles collide, their
instantaneous velocities are vectors lying on the line passing through
the centers of the spheres. There, you have the direction already.

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


Post a reply to this message

From: Disnel
Subject: Re: Particles (again...still)
Date: 27 Jun 2000 10:06:34
Message: <3958B4E4.6A7F1B62@itam.cas.cz>
I think, that its better to use POV language instead od VisualBasic,
because there you have vector operations already implemented, and
you will need them, I think. Secondary, if you want to share your
particle generator with others in the future, you must consider
that not everyone has windoze and thus Visual Basic.

Disnel

Matt Savard wrote:
> 
> Hello all,
> 
> I am attempting to make a primitive particle generator in Visual Basic to
> create scenes for POV. My math being a bit rusty, I only have it working in
> 2-D (x and y) I have all the write equations for making a particle travel in
> 2-D at a certain angle, but what is the formula for the Z direction? For
> example, I know to travel at 30 degrees in 2-d, you take the
> speed*Sin(angle_in_radians) for x and speed*Cos(angle_in_radians) for y.
> What would Z be?
> 
> Any help would be, well, helpful! :)
> 
> Matt


Post a reply to this message

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