POV-Ray : Newsgroups : povray.general : animated projectiles shot while moving : Re: animated projectiles shot while moving Server Time
9 Aug 2024 01:21:32 EDT (-0400)
  Re: animated projectiles shot while moving  
From: ryan constantine
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

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