POV-Ray : Newsgroups : povray.binaries.animations : Stacked Bouncing Balls (MPG, 404 KB) Server Time
19 Jul 2024 07:33:54 EDT (-0400)
  Stacked Bouncing Balls (MPG, 404 KB) (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: Tim Nikias v2 0
Subject: Re: Stacked Bouncing Balls (MPG, 404 KB)
Date: 19 Sep 2003 04:24:44
Message: <3f6abd4c@news.povray.org>
Good work! Parsing times?
How many steps required to simulate this?
I'm always interested in the complexity
of things like this...

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


> I've been having fun with my balls... uh, anyway, I've converted that old
C
> code of mine entirely to SDL.
>
> The physics, the ball collisions and rotations are pretty solid.
Stupidly,
> the part I haven't gotten my head around entirely is how to rotate the
> Povray spheres for display!  You'll notice the ball rotations "drift" a
> little, visually not rotating exactly as the physics engine is rotating.
> So, while the physics is doing the right thing, the Povray ball "rotation"
> visuals seem to indicate something's off, but it's just the sphere's
visual
> rotation.  I wish I could just directly apply my physics rotation vectors
> to the sphere.  I've got to fix that visual problem otherwise I'll need to
> make the balls solid colors ;-).  I'll work on that.
>
>


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


Post a reply to this message

From: Christoph Hormann
Subject: Re: Stacked Bouncing Balls (MPG, 404 KB)
Date: 19 Sep 2003 07:37:31
Message: <kh9r31-tht.ln1@triton.schunter.etc.tu-bs.de>
None wrote:
> I've been having fun with my balls... uh, anyway, I've converted that old C 
> code of mine entirely to SDL.
> 
> The physics, the ball collisions and rotations are pretty solid.  Stupidly, 
> the part I haven't gotten my head around entirely is how to rotate the 
> Povray spheres for display!  You'll notice the ball rotations "drift" a 
> little, visually not rotating exactly as the physics engine is rotating.  
> So, while the physics is doing the right thing, the Povray ball "rotation" 
> visuals seem to indicate something's off, but it's just the sphere's visual 
> rotation.  I wish I could just directly apply my physics rotation vectors 
> to the sphere.

You can apply any convential rotation matrix to a POV-Ray object using 
the 'matrix' keyword.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 2 Sep. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: None
Subject: Re: Stacked Bouncing Balls (MPG, 404 KB)
Date: 19 Sep 2003 15:39:39
Message: <Xns93FB9F50E8163None@204.213.191.226>
"Rune" <run### [at] runevisioncom> wrote in news:3f6ab6ef$1@news.povray.org:

> [...]
> This should be no problem. How are the rotation vectors in your psysics
> system stored? In what format?
> [...]

Yeah, I must have been tired because I wasn't getting it.  Haven't gotten 
back to it yet.

The rotation vector is actually stored in Pov world coordinates as a simple 
vector.  It represents how much the ball has rotated around that specific 
axis.  Of course, simply rotating the sphere with that vector causes the 
warble effect because the rotation is x, y then z.  I tried with a 
transformation matrix with sin's and cos's, but I wasn't getting it right 
(fatigue or I'm just a dummy?).  I also simply tried rotating on the axis 
perpendicular to the direction (basically, the rotation axis), but because 
direction changes suddenly this causes the ball's pattern to flip-flop.


Post a reply to this message

From: None
Subject: Re: Stacked Bouncing Balls (MPG, 404 KB)
Date: 19 Sep 2003 16:06:56
Message: <Xns93FBA3F1767D8None@204.213.191.226>
"Tim Nikias v2.0" <no_lights (@) digitaltwilight.de> wrote in 
news:3f6abd4c@news.povray.org:

> Good work! Parsing times?

Thanks.  Parsing times with only 10 balls are negligeable per frame, 0.1 
sec. or something like that.  I didn't record the total time, but it 
wasn't much.  But my collision detection is very simplified.  Ball to 
ball is simply: if (vlength(ball1 - ball2) < b1radius+b2radius).  And for 
the environment right now (the box) I'm simply putting up boundaries on 
the axes.  I'm not using trace() yet although my ball collision routine 
simply requires a world point and collision surface normal vector, so 
trace() should be easily implemented.  That's my next step, after I fix 
the texture rotation.  Earlier I threw 50 balls in the box for 10 seconds 
(physics time), at the beginning it's almost real time, half way it 
starts to slow down, then at the end, when it's all collisions going on 
it's real slow.  It took the night to run.

> How many steps required to simulate this?

For this spefific one I used 2000 steps per second and there was, uh, 3? 
seconds, I think.  Note that there is 30 frames per second, but I encoded 
the MPEG at 24 FPS, to slighly slo-mo it.

> I'm always interested in the complexity
> of things like this...

When I was at school (a long time ago) the physics of bouncing balls 
really interested me.  This little exercise has brought back that 
interest, it's fun stuff.


Post a reply to this message

From: None
Subject: Re: Stacked Bouncing Balls (MPG, 404 KB)
Date: 19 Sep 2003 16:11:54
Message: <Xns93FBA4C88C9BDNone@204.213.191.226>
Christoph Hormann <chr### [at] gmxde> wrote in
news:kh9### [at] tritonschunteretctu-bsde: 

> You can apply any convential rotation matrix to a POV-Ray object using
> the 'matrix' keyword.

Yeah, thanks.  But I seem to be matrix impaired.  I tried it but the 
balls' textures were sometimes skipping.  When I get back to it, hopefully 
I'll see things clearer.


Post a reply to this message

From: None
Subject: Re: Stacked Bouncing Balls (MPG, 404 KB)
Date: 19 Sep 2003 16:29:16
Message: <Xns93FBA7BA2F764None@204.213.191.226>
"Hugo Asm" <hua### [at] post3teledk> wrote in news:3f6b0ed6$1@news.povray.org:

> [...]
> Looks great. Out of curiosity: Can this be combined / imitated with the
> built-in MechSim in MegaPOV1.0 ?
> [...]

Thanks.

Combined?  I'm really not sure, but I don't think so, at least not 
without some tricks.  Simply because ball to MechSim collisions would be 
difficult to account for.  Actually, it may be possible.

Imitated?  Yes.  Someone posted an animation here earlier that used 
MechSim to simulate a ball with rotation.  The difference is that ball 
was a spherical grid composed of MechSim masses.  I don't think MechSim 
masses alone have rotation support.  That ball could also have an off-
center center of grativy, mine don't (yet).  That ball could also 
potentially deform on impact, not mine.  My technique is fairly simple 
but it's also extremely fast.  I should play with MechSim more, it looks 
great.  I loved the "floppy matresses" animations done by Andrew Cocker 
here.


Post a reply to this message

From: None
Subject: Re: Stacked Bouncing Balls (MPG, 404 KB)
Date: 19 Sep 2003 20:53:21
Message: <Xns93FBD47FAB451None@204.213.191.226>
None <Non### [at] onca> wrote in news:Xns### [at] 204213191226:

> "Rune" <run### [at] runevisioncom> wrote in
> news:3f6ab6ef$1@news.povray.org: 
> 
>> [...]
>> This should be no problem. How are the rotation vectors in your
>> psysics system stored? In what format?
>> [...]
> 
> Yeah, I must have been tired because I wasn't getting it.  Haven't
> [...]

I've been thinking about this all day and I think I've found the 
solution.  My problem all along, and the reason none of the things I 
tried, including the matrix transforms is because the rotation vector 
with which I make calculations is not located in the center of the balls, 
it's on the surface of the balls!!  DOH!  I knew I was too tired to crack 
this problem earlier.

Because they are balls and the surface is the everywhere the same, I'm 
thinking of doing something simple like:

    	rotate <0,RotY,0>
    	translate <0,BallRadius,0>
    	rotate <RotX,0,RotZ>
      Center_Trans(Ball, x+y+z)

Hopefully that should do the trick!  I'll post back with new animations 
if it is...


Post a reply to this message

From: Neonux
Subject: Re: Stacked Bouncing Balls (MPG, 404 KB)
Date: 19 Sep 2003 20:53:55
Message: <3f6ba523@news.povray.org>
Actually when I watch the "drift" it seems to me that the floor and the
spheres haven't much friction between them.  Is this a possibility?


Post a reply to this message

From: None
Subject: Re: Stacked Bouncing Balls (MPG, 404 KB)
Date: 19 Sep 2003 21:15:53
Message: <Xns93FBD851A526BNone@204.213.191.226>
None <Non### [at] onca> wrote in news:Xns### [at] 204213191226:
> [...]
>          rotate <0,RotY,0>
>          translate <0,BallRadius,0>
>          rotate <RotX,0,RotZ>
>       Center_Trans(Ball, x+y+z)
> [...]

Uh, Just realized the RotY rotate should be after the Center_Trans()... ok.


Post a reply to this message

From: None
Subject: Re: Stacked Bouncing Balls (MPG, 404 KB)
Date: 19 Sep 2003 21:22:14
Message: <Xns93FBD9655F7DENone@204.213.191.226>
"Neonux" <neo### [at] softhomenet> wrote in news:3f6ba523
@news.povray.org:

> Actually when I watch the "drift" it seems to me that the floor and the
> spheres haven't much friction between them.  Is this a possibility?

I can see what you mean but no.  The physics, as it is, doesn't allow 
frictionless contact or "sliding".  The problem was that with the way I was 
drawing the balls, the more a ball rotated the more the ball's texture 
rotation was off from the physics rotation.  The "drift" is actually that 
the balls are moving a little in direction A but the texture rotation is 
going in direction B, slightly off.  I think I have a solution for that 
now.  I will post the results here.


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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