|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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.
Post a reply to this message
Attachments:
Download 'BBStack.mpg' (405 KB)
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Oh, BTW, there is a front wall to the box containing the balls. It was
glass initially, but I thought it was in the way since it was the balls I
was interested in, so I made the front wall invisible. The balls have been
stacked with a random xz offset smaller than 1/1000 of their radius. My
physics engine doesn't introduce randomness so if the balls were stacked
perfectly lined up they wouldn't have fallen. The very slight offset,
gravity and time do the work.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Impressive. :)
> I wish I could just directly apply my physics
> rotation vectors to the sphere.
This should be no problem. How are the rotation vectors in your psysics
system stored? In what format?
Rune
--
3D images and anims, include files, tutorials and more:
rune|vision: http://runevision.com **updated Jul 25**
POV-Ray Ring: http://webring.povray.co.uk
Post a reply to this message
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
|
|