POV-Ray : Newsgroups : povray.binaries.animations : Bouncing Balls - (MPG, 155 KB) Server Time
19 Jul 2024 05:25:53 EDT (-0400)
  Bouncing Balls - (MPG, 155 KB) (Message 1 to 3 of 3)  
From: None
Subject: Bouncing Balls - (MPG, 155 KB)
Date: 13 Sep 2003 18:58:59
Message: <Xns93F5C115B796ANone@204.213.191.226>
Was looking at Micheal B.'s first post and it reminded me of something I 
did more than ten years ago.  Unfortunatly I lost most of the stuff I did 
on my Amiga since I got rid of it.  I had written a very simple C program 
to animate balls using one of the very first versions of Povray (it 
executed Povray at every frame).  I had made an animation with a bunch of 
frames, then averaged them using an AREXX script in ADPro (Art Department 
Pro) and compiled it into a Amiga animation file using the pseudo-24 bit 
output of my DCTV adapter... ahh memories.

Well, no traces of the animation anywhere but I did find an old copy of 
the source code to my bouncing balls.  It was so simple I tried 
converting it into SDL.  It was pretty straight forward, just needed to 
save all the variables to a file between frames.  I rendered the 
animation and averaged the frames using Warp's TGA averager.

Well, here it is, for my nostalgia almost faithful to the original 
(except for the sky and the soft shadows).  Simple fast code, simple  
collision detection, it actually handles movement in 3D, but in this 
animation the balls are only moving in 2D.

The closest ball has a small inital X velocity and no initial spin.
The second ball has a greater inital X velocity and a little spin.
The furthest ball has an even greater inital X velocity and a lot of 
spin.
All balls are rubber with high friction surfaces as is the floor.
If your player can play slow-mo, try it!

I'll see what I can do with this old code and where I can take it.  It 
was fun going back in time.  I still don't think my PC is as much fun as 
my Amiga was back then, I don't know why that is.  I must be a jaded 
adult now.


Post a reply to this message


Attachments:
Download 'BB.MPG' (156 KB)

From: Tim Nikias v2 0
Subject: Re: Bouncing Balls - (MPG, 155 KB)
Date: 14 Sep 2003 04:26:32
Message: <3f642638@news.povray.org>
They look quiet cute! Nice, bouncy balls!

How dou you derive the spin for the balls? That's
something that has interested me for years, but
I've never found any useful link on my own, from
I which I could understand how to do it. Is your
approach only suitable for spheres, or could it be
applied to boxes, cones etc? Any links?

-- 
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: no_lights (@) digitaltwilight.de


> Was looking at Micheal B.'s first post and it reminded me of something I
> did more than ten years ago.  Unfortunatly I lost most of the stuff I did
> on my Amiga since I got rid of it.  I had written a very simple C program
> to animate balls using one of the very first versions of Povray (it
> executed Povray at every frame).  I had made an animation with a bunch of
> frames, then averaged them using an AREXX script in ADPro (Art Department
> Pro) and compiled it into a Amiga animation file using the pseudo-24 bit
> output of my DCTV adapter... ahh memories.
>
> Well, no traces of the animation anywhere but I did find an old copy of
> the source code to my bouncing balls.  It was so simple I tried
> converting it into SDL.  It was pretty straight forward, just needed to
> save all the variables to a file between frames.  I rendered the
> animation and averaged the frames using Warp's TGA averager.
>
> Well, here it is, for my nostalgia almost faithful to the original
> (except for the sky and the soft shadows).  Simple fast code, simple
> collision detection, it actually handles movement in 3D, but in this
> animation the balls are only moving in 2D.
>
> The closest ball has a small inital X velocity and no initial spin.
> The second ball has a greater inital X velocity and a little spin.
> The furthest ball has an even greater inital X velocity and a lot of
> spin.
> All balls are rubber with high friction surfaces as is the floor.
> If your player can play slow-mo, try it!
>
> I'll see what I can do with this old code and where I can take it.  It
> was fun going back in time.  I still don't think my PC is as much fun as
> my Amiga was back then, I don't know why that is.  I must be a jaded
> adult now.
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 01.09.2003


Post a reply to this message

From: None
Subject: Re: Bouncing Balls - (MPG, 155 KB)
Date: 14 Sep 2003 11:44:53
Message: <Xns93F67780AB12ENone@204.213.191.226>
"Tim Nikias v2.0" <no_lights (@) digitaltwilight.de> wrote in 
news:3f642638@news.povray.org:

> They look quiet cute! Nice, bouncy balls!

LOL.  I must have been inspired by the "superballs" I used to have at the 
time.

> How dou you derive the spin for the balls? That's
> something that has interested me for years, but
> I've never found any useful link on my own, from
> I which I could understand how to do it. Is your
> approach only suitable for spheres, or could it be
> applied to boxes, cones etc? Any links?

It's an extremely simplified model, something I came up with way back 
then, before the internet :-).  So, as it is, it's only useful for 
spheres where the center of mass is in the middle of the spheres:

When a collision is detected, I convert the ball's speed and rotation 
vectors to vectors normalized to the collision surface normal, then I do 
simple collision and friction loss calculations.  If the collision is 
with another sphere, the rotation speed "vectors" collisions are 
calculated.  After, the perpendicular vx,vz (to collision normal) speed 
vectors are added to the related perpendicular rotation speed "vectors" 
vrz,vrx respectively, divided by two (averaged, but could be adjusted 
based on radius), minus a small friction loss penalty (released as heat 
;-).  The result is reassigned to both the perpendicular speed vectors 
and the related perpendicular rotation "vectors".  Finally reconverted to 
world speed and rotation vectors, and applied to positions.

So the perpendicular speed at collision and related rotation vectors are 
in bed together.  This simplified model does not allow for slippage.


Post a reply to this message

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