[Home] |
[Download] |
[Links] |
If you've ever wanted to automatically have objects appear, dissappear, and move then you might find this particle animation system very useful. I wrote Dave G's Particle Animation System (DGPAS) to automate most of the tasks involved with animating objects.
I don't mind using POV-Ray's clock variable to make an object appear and dissappear throughout the course of an animation. For example, if I want an object to appear one quarter of the way through and dissappear after three quarters of the animation I could type:
#declare Object_Shown = false |
But I find this a great deal of work. Especially when I have to do it for every object I want to appear.
And I don't mind moving an object along a path using the new clock variable. For example, after I declare Object_clock in the above example I could put:
#declare Start = <1,1,1> |
But again, this is tedious and repetitious if I have to write out the math for every object I want to move.
What I really needed was a way to do all the math as whenever I wanted without having to write it all out. So I wrote a little include file that automated the task.
Since I was making a position appear or dissappear, and I was moving only a point in space, I called the include file a particle animation system. All I had to do was set some varaibles and include the file. I didn't even have to place the object into the scene myself. For example:
#declare DGPASObject = |
- declare the object |
When DGPAS.INC takes over, it does all the work.
And that was how DGPAS started.
As I started to use my new include file I found it had some weaknesses.
So I kept adding functions to DGPAS. And here is an overview, in no particular order:
Reset All VariablesI created the command "RESET" to set all variables back to standard defaults. If you set a DGPAS variable, DGAS.INC will not alter its value. Therefore you can define a second particle by defining the changes from the previous one and including DGPAS.INC. But, this allows you to reset all DGPAS variables to known values. (If you loose track of previous settings). This was also put in place for programs that generate POV-Ray code (such as scene builders and modellers). Resetting assures the software of the value of all the variables. |
#declare DGPASCommand = "RESET" |
Place Objects YourselfDGPASObject_Type controls whether DGPAS automatically places the DGPASObject into the scene. |
// Place the object automatically |
Find Out Where to Place ObjectsDGPAS returns variables telling you if the particle is alive, how far the particle is through its lifespan, and where the particle is positioned. |
// Is the particle alive? |
Change the Time ScaleDGPASTime_Scale multiplies the clock variable to more manageable proportions. |
#declare DGPASTime_Scale = 100 |
Make A Particle Stay StillParticles can be declared as non-moving. If you plan on calculating the particles movement yourself, or if you are only using the particle as a timing device, this results in fewer calculations. |
#declare DGPASCommand = "STILL_PARTICLE" |
Give a Particle a VelocityParticles can be declared as having an initial position and a velocity. This velocity is applied over the life of the particle (Using the Time_Scaled clock value). |
#declare DGPASCommand = "VELOCITY_PARTICLE" |
Accelerate a ParticleYou can give a particle an acceleration as well as a velocity and starting point. |
#declare DGPASCommand = "VELOCITY_PARTICLE" |
Fold a Particle Along An AxisYou can constrain a particle within two points on any axis. If the particles motion would move it outside these points it is 'folded' back in the opposite direction until it is within the constraints. If you fold a particle along all 3 axis (X, Y, and Z) you are trapping a particle within a box. It will appear to bounce off of the walls as it travels. |
#declare DGPASFold_X = true |
Bounce a ParticleAnd you can cause a particle to bounce off of a point along one axis. You can easily create bouncing objects. To make the object more realistic you can make each bounce be smaller than the last. |
#declare DGPASCommand = "BOUNCE_PARTICLE" |
Well after all that adding I've taken a break long enough to write some documentation and let you help me test the file.
I do want to add more, but I don't want to make it too complicated to use. Adding features forever doesn't appeal to me. Making the system more powerful does.
And if you have any suggestions let me know!
Good Luck rendering!
[ Go Home ]
Hosted by Geocities, your free personal home page on the web.
This page copyright David Govoni 1997
Any
comments, or suggestions?
E-mail
me.