POV-Ray : Newsgroups : povray.general : animated projectiles shot while moving Server Time
9 Aug 2024 09:00:40 EDT (-0400)
  animated projectiles shot while moving (Message 11 to 20 of 22)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 2 Messages >>>
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

<<< Previous 10 Messages Goto Latest 10 Messages Next 2 Messages >>>

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