|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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)
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |
|
|