POV-Ray : Newsgroups : povray.binaries.animations : my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb Server Time
29 Jul 2024 04:33:13 EDT (-0400)
  my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb (Message 1 to 10 of 10)  
From: Raphael Quinet
Subject: my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb
Date: 6 Jun 2002 13:49:49
Message: <pan.2002.06.06.17.48.20.509044.13178@gamers.org>
I wanted to test my particle system (as described in the message that
I posted in povray.advanced-users) so I decided to create my very
first POV animation.  Since this is my first animation with POV-Ray, I
had to use the mandatory spheres on a checkered plane...  but I have
added some features from my particle system, of course.

I was inspired by the previous postings of bouncing cubes (balls and
springs) so I decided to do something similar.  In this animation,
there are three particle systems: the first one shows three cubes
bouncing on various objects (plane + spheres + cylinders).  When a
shpere hits another metallic object, it generates new particles: some
sparks.  The sparks are the second particle system.  And when a sphere
hits the water fast enough, there is a splash.  This is the third
particle system.

The springs in the cube bouncing close to the camera are very soft.
The other two cubes in the background have stiffer springs and keep
their original shape after bouncing.  Note that I only show the
springs at the outer edges of the cubes, but the simulation also uses
some diagonal springs that are hidden in the scene.

The animation was generated on a Linux laptop (650MHz) using the beta
RC5 of POV 3.5.  It contains 240 frames.  Here are some statistics for
this scene:
Time For Parse/Frame:    0 hours  0 minutes   5.6 seconds (5 seconds)
Time For Parse Total:    0 hours 22 minutes  18.0 seconds (1338 seconds)
Time For Trace/Frame:    0 hours  0 minutes  44.7 seconds (44 seconds)
Time For Trace Total:    2 hours 58 minutes  56.0 seconds (10736 seconds)
          Total Time:    3 hours 21 minutes  14.0 seconds (12074 seconds)

Since this is my first animation, I discovered that the MPEG
compression degrades the quality more than I expected.  Most of the
nice splashes in the background are completely lost.


--
http://www.gamers.org/~quinet/


Post a reply to this message


Attachments:
Download 'elasticbox.mpg' (605 KB)

From: Peter Hertel
Subject: Re: my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb
Date: 6 Jun 2002 14:27:54
Message: <3cffa9aa@news.povray.org>
> Since this is my first animation, I discovered that the MPEG
> compression degrades the quality more than I expected.  Most of the
> nice splashes in the background are completely lost.
DivX? =)

_Very_ nice! I love the sparks! The third cube (in the background) could
need a little help though, looks like it doesn't feel too well at the end of
the animation :) Fast render time too..?

-Peter


Post a reply to this message

From: Raphael Quinet
Subject: Re: my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb
Date: 6 Jun 2002 14:27:56
Message: <pan.2002.06.06.18.27.47.273131.13219@gamers.org>
Hmmm...  It looks like the last two bytes were stripped from the MPEG
file.  That's what I get for trying to hack a newsreader that does not
support posting of binary attachments.  ;-)  But I hope that most of
you will be able to play the animation without problems.

Although this will not be very useful until I release the source code
of my particle system, here is an excerpt from the scene file that I
used to generate the animation.  I am posting the following lines of
code in order to explain what I mean by a procedural API (see my
message in p.a-v): the main scene file calls several macros that
perform some actions on the particles.  Some of these macros can call
other user-defined macros, for example the macro pps_draw_particles()
calls the user-defined macro pps_user_draw_particle() several times.
Although this is not shown here, the macro pps_bounce() calls the
user-defined macro pps_user_hit_trigger() when a particle hits
something.  This is what allows me to trigger a splash or some sparks
using a second and third particle system.

  /* ... */
  #declare pps_target_time = 8 * clock;
  #declare pps_time_step = 0.01;

  #if (clock = 0)
    #declare pps_current_time = 0.0;
    // [...] some stuff to create the boxes (particles + springs)
  #else
    pps_load_from_file ("springbox_state.txt")
  #end
  
  // this defines the environment: this is a CSG union on which the particles
  // will bounce (one checkered plane and several spheres and cylinders)
  #declare bounce_obj = union {
    plane { y, 0
      pigment { checker color rgb 0.2 color rgb 1 }
    }
    union {
      // [...] several spheres and cylinders
    }
  }

  // run the particle system simulation
  #while (pps_iterate ())
    pps_gravity (PPS_DEFAULT_GRAVITY)
    pps_activate_springs ()
    pps_bounce (bounce_obj, 0.95, 0.07, 0)
    pps_move (0)
  #end
  pps_save_to_file ("springbox_state.txt")

  #macro pps_user_draw_particle (index, p_pos, p_size, p_velocity, p_orient, p_color,
age)
    sphere { p_pos, p_size }
  #end
  union {
    pps_draw_particles ()
    texture { T_Chrome_5D }
  }

  #macro pps_user_draw_spring (index, s_particle1, s_particle2, s_pos1, s_pos2,
s_size, s_color)
    // [...] a bit too long to post here
  #end
  union {
    pps_draw_springs ()
  }
  /* ... */

The other two particle systems (splash and sparks) use the same
structure as above, with slightly different actions in the main loop
of the simulation.  For example, here is what I used for the sparks
(of course, I redefine pps_user_draw_particle() for the sparks):

  #while (pps_iterate ())
    pps_kill_old (sparks_max_age)
    pps_gravity (PPS_DEFAULT_GRAVITY)
    pps_viscous_drag (0.9, 0, 1e9)
    pps_bounce (bounce_obj, 0.7, 0.05, 0)
    pps_move (0)
  #end
  pps_save_to_file ("sparks_state.txt")

By the way, all macros are prefixed with "pps_", for "POV Particle
System" because when I started this project a long time ago I was not
aware of other efforts to create particle systems for POV-Ray.  I am
wondering if I should rename this now that several of them are in
development...  Comments are welcome (but maybe you should post your
comments in povray.advanced-users, which is more appropriate for
discussing this kind of comments).


-- 
http://www.gamers.org/~quinet/


Post a reply to this message

From: Rune
Subject: Re: my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb
Date: 6 Jun 2002 14:51:44
Message: <3cffaf40@news.povray.org>
I love it! It shows just the kind of things I have dreamt of doing. I
can't wait to play with a particle system where everything can be
completely user-defined, thus allowing for maximum flexibility. :D

What I wonder is how the user-friendliness of your system is. Very often
flexibility comes at a price...

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:  http://rsj.mobilixnet.dk (updated May 20)
POV-Ray Users: http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Ring:  http://webring.povray.co.uk


Post a reply to this message

From: Greg M  Johnson
Subject: Re: my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb
Date: 7 Jun 2002 11:19:50
Message: <3d00cf16$1@news.povray.org>
I'm usually the first to whine about exotic formats, but I saw this one with
no probs.

Cool!
So what are the sparks?


Post a reply to this message

From: Raphael Quinet
Subject: Re: my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb
Date: 7 Jun 2002 12:02:43
Message: <pan.2002.06.07.16.02.42.409737.13134@gamers.org>
On Fri, 07 Jun 2002 14:33:08 +0200, Greg M. Johnson wrote:
> I'm usually the first to whine about exotic formats, but I saw this one
> with no probs.

Well, the format is not exotic (just standard MPEG created with
mpeg_encode) but the problem occured while posting the message.  Since
I cannot use my home PC for the moment (hard disk crash), I am using
another PC on which the newsreader does not support posting of binary
attachments (Pan is very nice for reading, but not for posting).  So I
had to create the mime multipart message by hand and do the base64
encoding of the file.  Apparently I lost the last 2 bytes while doing
the conversion.  That's why I was a bit worried, but apparently most
MPEG players are very tolerant and they play the animation without
problems.

> Cool!
> So what are the sparks?
 
The sparks are made with a bunch of particles that are moved by my
particle system.  Each of these particles is drawn as a sphere
containing emitting and absorbing media.  Nothing very exotic.  To
be more specific, here is exactly what these sparks are:

// definition of the sparks
#macro pps_user_draw_particle (index, p_pos, p_size, p_velocity,
                               p_orient, p_color, age)
  #local age_ratio = 1 - age / sparks_max_age;
  sphere { <0, 0, 0>, 1
    hollow on
    texture { pigment { rgbt 1 } }
    interior {
      media {
        intervals 1
        samples 5, 10
        method 3
        emission <1, 0.9, 0.6> * 10 * (0.5 + age_ratio)
        absorption <0, 0.1, 0.4> * 10 * (0.3 + age_ratio)
        density { spherical }
      }
    }
    scale 0.03 * sqrt (age_ratio)
    translate p_pos
  }
#end
// include all sparks in the scene
pps_draw_particles ()


-- 
http://www.gamers.org/~quinet/


Post a reply to this message

From: Rune
Subject: Re: my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb
Date: 7 Jun 2002 12:04:29
Message: <3d00d98d$1@news.povray.org>
Greg M. Johnson wrote:
> I'm usually the first to whine about exotic formats,
> but I saw this one with no probs.

Err, it was a plain mpg animation...

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:  http://rsj.mobilixnet.dk (updated May 20)
POV-Ray Users: http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Ring:  http://webring.povray.co.uk


Post a reply to this message

From: Raphael Quinet
Subject: Re: my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb
Date: 7 Jun 2002 12:11:00
Message: <pan.2002.06.07.16.10.59.383544.13134@gamers.org>
On Thu, 06 Jun 2002 20:53:09 +0200, Rune wrote:
> I love it! It shows just the kind of things I have dreamt of doing. I
> can't wait to play with a particle system where everything can be
> completely user-defined, thus allowing for maximum flexibility. :D

Thanks!

> What I wonder is how the user-friendliness of your system is. Very often
> flexibility comes at a price...

Well...  From my point of view the system is very user-friendly (with
me as the user).  :-)  But you will soon be able to judge for yourself.

Anyway, the price to pay is a small sacrifice in speed.  Since each
macro is called separately (one call to pps_gravity(), then one call
to pps_bounce(), then one call to pps_move(), etc.) it is necessary
for each macro to loop over all particles.  Having several #while
loops in different macros is a bit slower than if all the code was in
one big macro.  But I don't think that the difference is so big, and
the added flexibility is definitely worth it, IMHO.


-- 
http://www.gamers.org/~quinet/


Post a reply to this message

From: Gergely Vandor
Subject: Re: my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb
Date: 8 Jun 2002 22:12:10
Message: <Xns92282AC104C65gergelyvamoraviaitco@204.213.191.226>
Raphael Quinet <qui### [at] gamersorg> wrote in
news:pan### [at] gamersorg: 

> I wanted to test my particle system (as described in the message that
> I posted in povray.advanced-users) so I decided to create my very
> first POV animation.  Since this is my first animation with POV-Ray, I
> had to use the mandatory spheres on a checkered plane...  but I have
> added some features from my particle system, of course.

Pretty cool.

> 
> I was inspired by the previous postings of bouncing cubes (balls and
> springs) so I decided to do something similar.

May I call myself the initiator of the Elastic Cube Movement? :)

At least I think mine was the first one coded in pov sdl and posted
here. :) (In fact an earlier version of it can be found somewhere on this 
server, so I pretty much think I am the Pov-Ray Elastic Cube Pioneer.)

Sorry for this useless post. :)

--
Gergely


Post a reply to this message

From: Apache
Subject: Re: my first animation: spheres and checkered plane (and springs, particles, water, ...) - 619kb
Date: 9 Jun 2002 04:49:44
Message: <3d0316a8$1@news.povray.org>
I can remember you, yes. I think you should try to uphold your Elastic Cube
Movement imago by posting some animations.

--
Apache
POV-Ray Cloth experiments: http://geitenkaas.dns2go.com/experiments/
Email: apa### [at] yahoocom
ICQ: 146690431


Post a reply to this message

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