POV-Ray : Newsgroups : povray.general : animated projectiles shot while moving Server Time
16 Oct 2026 08:46:09 EDT (-0400)
  animated projectiles shot while moving (Message 1 to 22 of 22)  
From: ryan constantine
Subject: animated projectiles shot while moving
Date: 1 Sep 2000 03:05:22
Message: <39AF5509.75964A45@yahoo.com>
has anyone done this before?  what i want to do is shoot a projectile in
an animation simply by setting a variable like shoot=true or something
like that.  then, while it is true, i'd like a shot to be fired at
either steady or random intervals until set to false.  each shot should
be its own entity.  it should query the host object to know which
direction to move and from where it should start.  then it should know
when it hits something and do something when it does.  the projectile i
have in mind is a laser blast.  would the particle patch help me here? 
suggestions anyone?


Post a reply to this message

From: Bob Hughes
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 03:42:20
Message: <39af5ddc$1@news.povray.org>
"ryan constantine" <rco### [at] yahoocom> wrote in message
news:39AF5509.75964A45@yahoo.com...
| has anyone done this before?  what i want to do is shoot a projectile in
| an animation simply by setting a variable like shoot=true or something
| like that.  then, while it is true, i'd like a shot to be fired at
| either steady or random intervals until set to false.  each shot should
| be its own entity.  it should query the host object to know which
| direction to move and from where it should start.  then it should know
| when it hits something and do something when it does.  the projectile i
| have in mind is a laser blast.  would the particle patch help me here?
| suggestions anyone?

Probably been tried at least.  Sounds a bit like a mix of ranges and
detection; Greg Johnson or Rune Johansen, to name a couple of people, might
have a explanation for you.
I'd say you would use #switch and #range for the main timing and then a #if
conditional to see when a object vector is near the projectile, like
#if(ObjectAreaPosition*ProjectileAreaPosition<ContactDistance).  Takes some
squaring of the area around each to know what space they occupy.
I would think trace() could do fine for this, especially because of the
non-spherical boundaries you would probably want to be using.  But then
there's all the rest involved, such as moving the projectile in the proper
direction.  Long story short, I have yet to do that myself.

Bob


Post a reply to this message

From: Greg M  Johnson
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 08:27:59
Message: <39AF9F93.4A990D21@my-dejanews.com>
ryan constantine wrote:

> has anyone done this before?  what i want to do is shoot a projectile in
> an animation simply by setting a variable like shoot=true or something
> like that.  then, while it is true, i'd like a shot to be fired at
> either steady or random intervals until set to false.  each shot should
> be its own entity.  it should query the host object to know which
> direction to move and from where it should start.  then it should know
> when it hits something and do something when it does.  the projectile i
> have in mind is a laser blast.  would the particle patch help me here?
> suggestions anyone?

I had been thinking of setting up my own missile defense animation and see
how hard it was!

I was about to give longer advice here , but I got confused by the concept
of a laser "querying its host object".

You can set up a system where you have eight variables defining your "flying
duck".

Position    (3 variables xyz, affected by velocity)
Velocity    (3 variables xyz, affected by gravity, willful acceleration)
DeadYet     (0=alive; 1=dead)
TimeoDeath  (Number of time frames SINCE I've been shot.  )


#if(DeadYet>0.5)
    #declare TimeoDeath=TimeoDeath+1;
#else
    #if(vlength (Postion-Bulletposition)<ContactDistance)  // ala Bob H
        #declare DeadYet=1;
    #end
#end

Then display duck, duck fragments, etc., based on above variables.

See:

http://www.geocities.com/pterandon/boids.html


Post a reply to this message

From: Bob Hughes
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 08:56:55
Message: <39afa797@news.povray.org>
"Greg M. Johnson" <gre### [at] my-dejanewscom> wrote in message
news:39AF9F93.4A990D21@my-dejanews.com...
|     #if(vlength (Postion-Bulletposition)<ContactDistance)  // ala Bob H

Hey, don't include me there  :-)
Been trying to get a look at old Basic code I have here for some refresh of
the memory and only just now managed to get it out of binary form so I can
read it once again.  It's no wonder I never made it in programming.

Bob


Post a reply to this message

From: Greg M  Johnson
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 10:06:39
Message: <39AFB6B7.77732404@my-dejanews.com>
If your code snippet had been literally applicable, I would have written "as
per Bob H".

I'm so fluent (IMHO) at povray but barf extensively every time I pick up a C or
Java book that it's just a wonder why the original langs are so crappy.

Bob Hughes wrote:

> "Greg M. Johnson" <gre### [at] my-dejanewscom> wrote in message
> news:39AF9F93.4A990D21@my-dejanews.com...
> |     #if(vlength (Postion-Bulletposition)<ContactDistance)  // ala Bob H
>
> Hey, don't include me there  :-)
> Been trying to get a look at old Basic code I have here for some refresh of
> the memory and only just now managed to get it out of binary form so I can
> read it once again.  It's no wonder I never made it in programming.
>
> Bob


Post a reply to this message

From: ryan constantine
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 11:40:39
Message: <39AFCDF8.D6B0A9FF@yahoo.com>
by "query the host object" i mean it can find the end of the muzzle as
well as the direction it is pointing in order to know which drection to
shoot.  maybe the host (space ship) should set global variables
indicating where the muzzle tip is and the direction.  then the laser
would just use the globals.  what do you think?

"Greg M. Johnson" wrote:
> 
> ryan constantine wrote:
> 
> > has anyone done this before?  what i want to do is shoot a projectile in
> > an animation simply by setting a variable like shoot=true or something
> > like that.  then, while it is true, i'd like a shot to be fired at
> > either steady or random intervals until set to false.  each shot should
> > be its own entity.  it should query the host object to know which
> > direction to move and from where it should start.  then it should know
> > when it hits something and do something when it does.  the projectile i
> > have in mind is a laser blast.  would the particle patch help me here?
> > suggestions anyone?
> 
> I had been thinking of setting up my own missile defense animation and see
> how hard it was!
> 
> I was about to give longer advice here , but I got confused by the concept
> of a laser "querying its host object".
> 
> You can set up a system where you have eight variables defining your "flying
> duck".
> 
> Position    (3 variables xyz, affected by velocity)
> Velocity    (3 variables xyz, affected by gravity, willful acceleration)
> DeadYet     (0=alive; 1=dead)
> TimeoDeath  (Number of time frames SINCE I've been shot.  )
> 
> #if(DeadYet>0.5)
>     #declare TimeoDeath=TimeoDeath+1;
> #else
>     #if(vlength (Postion-Bulletposition)<ContactDistance)  // ala Bob H
>         #declare DeadYet=1;
>     #end
> #end
> 
> Then display duck, duck fragments, etc., based on above variables.
> 
> See:
> 
> http://www.geocities.com/pterandon/boids.html


Post a reply to this message

From: Greg M  Johnson
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 12:08:35
Message: <39AFD342.B2568C98@my-dejanews.com>
ryan constantine wrote:

> by "query the host object" i mean it can find the end of the muzzle as
> well as the direction it is pointing in order to know which drection to
> shoot.  maybe the host (space ship) should set global variables
> indicating where the muzzle tip is and the direction.  then the laser
> would just use the globals.  what do you think?

Still confused.

EITHER
------------------------------------------------------------

// LASER BEAM: SPEED OF LIGHT

#declare laserhit=trace(Duck, LaserAim, LaserPosition, Norm);

#if( Norm.x!=0&Norm.y!=0&Norm.z!=0)   //syntax may be a bit off
         #declare DeadYet=1;
#end

---------------------------------------------------

 //        OR SHOOT A BUNCH OF BULLETS

#declare Bulletposition=Bulletposition+0.1*Bulletveloc;
#declare Bulletveloc=Bulletveloc-0.1*y;

#if(DeadYet>0.5)
    #declare TimeoDeath=TimeoDeath+1;
#else
    #if(vlength (DuckPostion-Bulletposition)<ContactDistance)  // ala Greg
        #declare DeadYet=1;
    #end
#end


Post a reply to this message

From: Chris Huff
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 12:11:18
Message: <chrishuff-07BB65.11125501092000@news.povray.org>
In article <39AF5509.75964A45@yahoo.com>, ryan constantine 
<rco### [at] yahoocom> wrote:

> has anyone done this before?  what i want to do is shoot a projectile in
> an animation simply by setting a variable like shoot=true or something
> like that.  then, while it is true, i'd like a shot to be fired at
> either steady or random intervals until set to false.  each shot should
> be its own entity.  it should query the host object to know which
> direction to move and from where it should start.  then it should know
> when it hits something and do something when it does.  the projectile i
> have in mind is a laser blast.  would the particle patch help me here? 
> suggestions anyone?

The particle_system patch might help, though this particle system is 
pretty easy to implement in POV-Script. I don't know if the ParticlePOV 
patch will be of any use in this.
I have done something very similar to this in POV-Script while 
stress-testing my #set patch, I will post an image in p.b.i soon. While 
the source uses #set, it can easily be changed to use #local and 
#declare(it will just hurt readability).

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

<><


Post a reply to this message

From: Chris Calef
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 16:15:48
Message: <39B00E1F.A5183C3A@orcasinc.com>
Hi.  I'm new to this group, but I've been off in my own little cave working on
the problem of physics-based motion in povray for a little while now.  At the
moment I'm working on a "frog" that points in a random direction and leaps
according to a random vector, then slides and when it gets slow enough jumps
again.  Forgive me if I betray serious ignorance here, but in my
experimentation I haven't found any way to save persistent variables from one
frame to the next in povray without writing them out to a text file, so that's
what I'm doing.  (code snippet below)
It seems like "querying the host object" is sort of backwards... wouldn't you
create the projectile object and give it position and move vectors based on
the known muzzle position and angle?  If you don't know the muzzle position
and angle because the ship has moved and rotated, then you'd have to apply the
same transformations to the original muzzle coordinates that you applied to
the ship... does that make sense? (believe it or not, english actually is my
first language.)

#declare gravity_vector = <0,-8,0>;
#declare drag = 0.9;

#fopen FrogFile "frog.dat" read
#read (FrogFile,frog_position,frog_move,rot_y,rot_x)
#fclose FrogFile

#declare frog_move = (frog_move + gravity_vector) * drag;
#declare frog_position = frog_position + frog_move;

#fopen FrogFile "frog.dat" write
#write (FrogFile,frog_position,",",frog_move,",",rot_y,",",rot_x,",\n")
#fclose FrogFile

If anyone knows how I can save these variables without writing out to frog.dat
I'd be very happy!


"Greg M. Johnson" wrote:

> ryan constantine wrote:
>
> > by "query the host object" i mean it can find the end of the muzzle as
> > well as the direction it is pointing in order to know which drection to
> > shoot.  maybe the host (space ship) should set global variables
> > indicating where the muzzle tip is and the direction.  then the laser
> > would just use the globals.  what do you think?
>
> Still confused.
>
> EITHER
> ------------------------------------------------------------
>
> // LASER BEAM: SPEED OF LIGHT
>
> #declare laserhit=trace(Duck, LaserAim, LaserPosition, Norm);
>
> #if( Norm.x!=0&Norm.y!=0&Norm.z!=0)   //syntax may be a bit off
>          #declare DeadYet=1;
> #end
>
> ---------------------------------------------------
>
>  //        OR SHOOT A BUNCH OF BULLETS
>
> #declare Bulletposition=Bulletposition+0.1*Bulletveloc;
> #declare Bulletveloc=Bulletveloc-0.1*y;
>
> #if(DeadYet>0.5)
>     #declare TimeoDeath=TimeoDeath+1;
> #else
>     #if(vlength (DuckPostion-Bulletposition)<ContactDistance)  // ala Greg
>         #declare DeadYet=1;
>     #end
> #end


Post a reply to this message

From: Rune
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 16:39:42
Message: <39b0140e@news.povray.org>
"ryan constantine" wrote:
> has anyone done this before?

Yes! :-)

My never released Missile Bot game did that among many other things.

> the projectile i have in mind is a laser blast.

First of all, note that the method I use is useful only if the projectiles
move relatively slow (slow enough for the eye to see). Realistic gun shots
or laser blasts move far too fast.

> suggestions anyone?

The method I use is frame dependent. At the end of each frame I save data to
a file, and this data is then read in the next frame using #include. Maybe
you could use MegaPOV persistent variables instead, but I have never used
those myself.

I suggest you create 3 arrays that hold information about the projectiles.
One array holds projectile location vectors, one holds projectile direction
vectors, and one holds projectile status (a float).

The status could be:
0 = projectile not active,
1 = projective flying,
2-3 = projective exploding. (goes from 2 to 3 as the explosion evolves)

The three one-dimensional arrays must all have the same number of elements.
The number of elements should be the maximum possible number of simultaneous
projectiles.

In the first frame of the animation you fill the location array with <0,0,0>
in all the elements, similar with the direction array, and the status array
you fill with 0.

In the end of each frame you must write (in POV syntax) the 3 arrays into an
include file.
In the start of each frame (except the first) this include file is included.

At the time when you set Fire = on (or whatever), you pick an inactive
projectile and set it's location to the same location as your turret. The
projectile's direction is set to the direction the turret is pointing. The
status is set to 1.

Wait a minute, I'm not even halfway with the explanation - I can see that
this is too complicated for me to explain. Instead I will try to make you a
sample file that shows the technique. It may take a little while...

Greetings,

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated July 23)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Rune
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 18:19:16
Message: <39b02b64@news.povray.org>
"Rune" wrote:
> I will try to make you a sample file that shows the technique.
> It may take a little while...

On second thought - before I start coding I would like to know some more
details. Do your laser blast move with the speed of light (practically
infinitely fast), or should the blast be followed by the eye? Should the
projectiles be affected by forces such as gravity, or should they simply
travel linearly?

Additional information is also appreciated!

Greetings,

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated July 23)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: ryan constantine
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 19:35:48
Message: <39B03D0C.6235762A@yahoo.com>
in megapov you can have persistent variables through an animation

Chris Calef wrote:
> 
> Hi.  I'm new to this group, but I've been off in my own little cave working on
> the problem of physics-based motion in povray for a little while now.  At the
> moment I'm working on a "frog" that points in a random direction and leaps
> according to a random vector, then slides and when it gets slow enough jumps
> again.  Forgive me if I betray serious ignorance here, but in my
> experimentation I haven't found any way to save persistent variables from one
> frame to the next in povray without writing them out to a text file, so that's
> what I'm doing.  (code snippet below)
> It seems like "querying the host object" is sort of backwards... wouldn't you
> create the projectile object and give it position and move vectors based on
> the known muzzle position and angle?  If you don't know the muzzle position
> and angle because the ship has moved and rotated, then you'd have to apply the
> same transformations to the original muzzle coordinates that you applied to
> the ship... does that make sense? (believe it or not, english actually is my
> first language.)
> 
> #declare gravity_vector = <0,-8,0>;
> #declare drag = 0.9;
> 
> #fopen FrogFile "frog.dat" read
> #read (FrogFile,frog_position,frog_move,rot_y,rot_x)
> #fclose FrogFile
> 
> #declare frog_move = (frog_move + gravity_vector) * drag;
> #declare frog_position = frog_position + frog_move;
> 
> #fopen FrogFile "frog.dat" write
> #write (FrogFile,frog_position,",",frog_move,",",rot_y,",",rot_x,",\n")
> #fclose FrogFile
> 
> If anyone knows how I can save these variables without writing out to frog.dat
> I'd be very happy!
> 
> "Greg M. Johnson" wrote:
> 
> > ryan constantine wrote:
> >
> > > by "query the host object" i mean it can find the end of the muzzle as
> > > well as the direction it is pointing in order to know which drection to
> > > shoot.  maybe the host (space ship) should set global variables
> > > indicating where the muzzle tip is and the direction.  then the laser
> > > would just use the globals.  what do you think?
> >
> > Still confused.
> >
> > EITHER
> > ------------------------------------------------------------
> >
> > // LASER BEAM: SPEED OF LIGHT
> >
> > #declare laserhit=trace(Duck, LaserAim, LaserPosition, Norm);
> >
> > #if( Norm.x!=0&Norm.y!=0&Norm.z!=0)   //syntax may be a bit off
> >          #declare DeadYet=1;
> > #end
> >
> > ---------------------------------------------------
> >
> >  //        OR SHOOT A BUNCH OF BULLETS
> >
> > #declare Bulletposition=Bulletposition+0.1*Bulletveloc;
> > #declare Bulletveloc=Bulletveloc-0.1*y;
> >
> > #if(DeadYet>0.5)
> >     #declare TimeoDeath=TimeoDeath+1;
> > #else
> >     #if(vlength (DuckPostion-Bulletposition)<ContactDistance)  // ala Greg
> >         #declare DeadYet=1;
> >     #end
> > #end


Post a reply to this message

From: ryan constantine
Subject: Re: animated projectiles shot while moving
Date: 1 Sep 2000 19:41:57
Message: <39B03E7C.B43D7A3F@yahoo.com>
i'm surprised noone guessed that i'm going to try a star wars scene, in
which case you can see the blasts.  they will be fired by ships and by
turrets and battle stations.  the blasts should travel linearly.  i
think blasts will either hit a target already on screen, or move off
screen, although an option to follow it with the camera may be useful
down the road.  i think traditionally in movies, torpedoes are more
likely to be followed by the camera.  oh, i guess i'll need torpedos to
go in the death star's exhaust port, but again, those are scene cuts,
not camera following.  thanks for the help.

Rune wrote:
> 
> "Rune" wrote:
> > I will try to make you a sample file that shows the technique.
> > It may take a little while...
> 
> On second thought - before I start coding I would like to know some more
> details. Do your laser blast move with the speed of light (practically
> infinitely fast), or should the blast be followed by the eye? Should the
> projectiles be affected by forces such as gravity, or should they simply
> travel linearly?
> 
> Additional information is also appreciated!
> 
> Greetings,
> 
> Rune
> --
> \ Include files, tutorials, 3D images, raytracing jokes,
> / The POV Desktop Theme, and The POV-Ray Logo Contest can
> \ all be found at http://rsj.mobilixnet.dk (updated July 23)
> / Also visit http://www.povrayusers.org


Post a reply to this message

From: Rune
Subject: Re: animated projectiles shot while moving
Date: 2 Sep 2000 08:23:59
Message: <39b0f15f@news.povray.org>
"ryan constantine" wrote:
> i'm surprised noone guessed that i'm going to try a star wars scene,
> in which case you can see the blasts.

I thought of that, but I couldn't be sure.

> they will be fired by ships and by turrets and battle stations.
> the blasts should travel linearly.

Excellent!

See my post "Auto Shoot" in povray.binaries.scene-files

Please tell me what you think of it, and if you find it useful.

If you need help modifying it to your needs, just ask me! :-)

> i think blasts will either hit a target already on screen, or move
> off screen, although an option to follow it with the camera may be
> useful down the road.

My solution can do all that.

> i think traditionally in movies, torpedoes are more likely to be
> followed by the camera.  oh, i guess i'll need torpedos to
> go in the death star's exhaust port, but again, those are scene
> cuts, not camera following.

My solution works with torpedoes if they move linearly.
It could be changed to behave differently though.

> thanks for the help.

Hope you can use it!

Greetings,

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated July 23)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Chris Huff
Subject: Re: animated projectiles shot while moving
Date: 2 Sep 2000 09:07:47
Message: <chrishuff-8753D2.08092502092000@news.povray.org>
In article <39b0f15f@news.povray.org>, "Rune" <run### [at] inamecom> 
wrote:

> My solution works with torpedoes if they move linearly.

My solution can simulate the effect of gravity on the projectile, which 
I guess doesn't make it very good for "guided" projectiles. It would be 
possible to make a simulation which does that, though...either by 
specifying the path with a spline, or by telling it to target a specific 
point. If the blasts go in a straight line, the solution is much simpler.

-- 
Christopher James Huff
Personal: 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: animated projectiles shot while moving
Date: 2 Sep 2000 09:22:34
Message: <39b0ff1a@news.povray.org>
"Chris Huff" wrote:
> My solution can simulate the effect of gravity on the projectile, which
> I guess doesn't make it very good for "guided" projectiles. It would be
> possible to make a simulation which does that, though...either by
> specifying the path with a spline, or by telling it to target a specific
> point. If the blasts go in a straight line, the solution is much simpler.

My solution could also do all those things if I had made it that way, but
since ryan requested linearly moving projectiles, that is what I made! :-)

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated July 23)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: ryan constantine
Subject: Re: animated projectiles shot while moving
Date: 2 Sep 2000 14:40:42
Message: <39B149AF.923ECD88@yahoo.com>
i slept in today, so i just got here guys.  i'll check out your stuff
rune.  i'm currently changing my xwing textures so i'll do a test
animation of this in a week or so.  i will read through it today,
however, and i should be able to see if it meets my needs.  i'll get
back to you.    TIA.

Rune wrote:
> 
> "Chris Huff" wrote:
> > My solution can simulate the effect of gravity on the projectile, which
> > I guess doesn't make it very good for "guided" projectiles. It would be
> > possible to make a simulation which does that, though...either by
> > specifying the path with a spline, or by telling it to target a specific
> > point. If the blasts go in a straight line, the solution is much simpler.
> 
> My solution could also do all those things if I had made it that way, but
> since ryan requested linearly moving projectiles, that is what I made! :-)
> 
> Rune
> --
> \ Include files, tutorials, 3D images, raytracing jokes,
> / The POV Desktop Theme, and The POV-Ray Logo Contest can
> \ all be found at http://rsj.mobilixnet.dk (updated July 23)
> / Also visit http://www.povrayusers.org


Post a reply to this message

From: ryan constantine
Subject: Re: animated projectiles shot while moving
Date: 2 Sep 2000 19:48:38
Message: <39B191C7.A269CE00@yahoo.com>
i tested your file.  looks good.  i'll definitely use it for the gun
turrets. of course i'll have to make the lasers and explosions prettier,
but i'm sure you were just getting the mechanics and a quick render to
me and not a work of art.  i'll have to read it closer to see how to
adapt it to the blasters on a moving starfighter.  i suppose i could
make a separate include for each object that shoots something huh?  or
include the same file with various params #declared first...

thanks

ryan constantine wrote:
> 
> i slept in today, so i just got here guys.  i'll check out your stuff
> rune.  i'm currently changing my xwing textures so i'll do a test
> animation of this in a week or so.  i will read through it today,
> however, and i should be able to see if it meets my needs.  i'll get
> back to you.    TIA.
> 
> Rune wrote:
> >
> > "Chris Huff" wrote:
> > > My solution can simulate the effect of gravity on the projectile, which
> > > I guess doesn't make it very good for "guided" projectiles. It would be
> > > possible to make a simulation which does that, though...either by
> > > specifying the path with a spline, or by telling it to target a specific
> > > point. If the blasts go in a straight line, the solution is much simpler.
> >
> > My solution could also do all those things if I had made it that way, but
> > since ryan requested linearly moving projectiles, that is what I made! :-)
> >
> > Rune
> > --
> > \ Include files, tutorials, 3D images, raytracing jokes,
> > / The POV Desktop Theme, and The POV-Ray Logo Contest can
> > \ all be found at http://rsj.mobilixnet.dk (updated July 23)
> > / Also visit http://www.povrayusers.org


Post a reply to this message

From: Rune
Subject: Re: animated projectiles shot while moving
Date: 3 Sep 2000 09:58:27
Message: <39b25903@news.povray.org>
"ryan constantine" wrote:
> i tested your file.  looks good.  i'll definitely use it for
> the gun turrets.

Glad you can use it!

> of course i'll have to make the lasers and explosions
> prettier, but i'm sure you were just getting the mechanics
> and a quick render to me and not a work of art.

Exactly.

> i'll have to read it closer to see how to adapt it to the
> blasters on a moving starfighter.  i suppose i could make a
> separate include for each object that shoots something huh?

You could do that.

> or include the same file with various params #declared first...

I think that would be a better solution. However, you would need to specify
different data file names. Before each time you include it, write something
like:

#declare DataFileName = "data1.inc"
#include "autoshoot.inc"

#declare DataFileName = "data2.inc"
#include "autoshoot.inc"

In autoshoot.inc you replace "data.inc" with DataFileName

That way you can use multiple instances of the include file, and they won't
overwrite each other's data.

Greetings,

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated July 23)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Fran Firman
Subject: Re: animated projectiles shot while moving
Date: 4 Sep 2000 20:00:27
Message: <B5DA5968yf@palm>
> has anyone done this before?  what i want to do is shoot a 
> projectile in

Yes  I have done a simular system.
If you go to http://zap.to/reallife I have an animation called 
blast that shows what I did. It will take me a little while to 
get the source code out into a readable form thou. 

> an animation simply by setting a variable like shoot=true or 
> something
> like that.  then, while it is true, i'd like a shot to be 
> fired at
> either steady or random intervals until set to false.  each 
> shot should
> be its own entity.  it should query the host object to know 
> which
> direction to move and from where it should start.  then it 
> should know
> when it hits something and do something when it does.  the 
> projectile i
> have in mind is a laser blast.  would the particle patch help 
> me here? 
> suggestions anyone?
-- 
Piloteers do it on the road


Post a reply to this message

From: Chris Calef
Subject: Re: animated projectiles shot while moving
Date: 5 Sep 2000 19:16:40
Message: <39B57E73.C88B9F6A@orcasinc.com>
Thanks, that's good to know.  I started using Megapov but had a lot of trouble with
it, scripts that worked fine in regular povray came up with a lot of errors.  I'll
try it again, though, it sounds worth it.  (I was using version 0.5, has it gotten
better?

-- Chris

ryan constantine wrote:

> in megapov you can have persistent variables through an animation


Post a reply to this message

From: ryan constantine
Subject: Re: animated projectiles shot while moving
Date: 6 Sep 2000 01:28:40
Message: <39B5D562.40FA6482@yahoo.com>
there is now 0.5a and 0.5a+.  the first is located at the regular
megapov site, the second is at chris huff's site.

Chris Calef wrote:
> 
> Thanks, that's good to know.  I started using Megapov but had a lot of trouble with
> it, scripts that worked fine in regular povray came up with a lot of errors.  I'll
> try it again, though, it sounds worth it.  (I was using version 0.5, has it gotten
> better?
> 
> -- Chris
> 
> ryan constantine wrote:
> 
> > in megapov you can have persistent variables through an animation


Post a reply to this message

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