POV-Ray : Newsgroups : povray.general : animated projectiles shot while moving : Re: animated projectiles shot while moving Server Time
9 Aug 2024 01:26:09 EDT (-0400)
  Re: animated projectiles shot while moving  
From: Greg M  Johnson
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

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