POV-Ray : Newsgroups : povray.general : Physics - collision detection etc Server Time
8 Aug 2024 10:26:36 EDT (-0400)
  Physics - collision detection etc (Message 1 to 10 of 18)  
Goto Latest 10 Messages Next 8 Messages >>>
From: Andy Cocker
Subject: Physics - collision detection etc
Date: 25 Jan 2001 15:37:34
Message: <3a708e8e@news.povray.org>
Is anybody actively working on equipping POV with collision-detection, and
real-world physical behaviour to objects? I understand that Chris Colefax is
holding off on his work until POV 3.5 is released (am I correct on this?).

I am asking simply because I have long wished for the capability of
animating objects simply by defining their characteristics (mass, elasticity
etc), and letting POV do the rest, but there is no way that I could even
begin to code this myself. I honestly wouldn't know where to start.

I gather there are internal shortcomings regarding the detection of an
objects extremeties (am I correct on this also?), but can these be overcome?
How does other software (proprietary in house animation software in
particular) achieve this?

Apologies if you think this should have been posted in povray.advanced-users

--
Andy Cocker

---------------------------------------------------------------
listen to my music at:
www.mp3.com/lunarland
---------------------------------------------------------------

'I spilled spot remover on my dog. He's gone now. '
'I went to a restaurant that serves "breakfast at any time."
So I ordered french toast during the Renaissance. '

 - Steven Wright.
---------------------------------------------------------------


Post a reply to this message

From: David Buck
Subject: Re: Physics - collision detection etc
Date: 25 Jan 2001 16:18:17
Message: <3A709881.20F7E81E@simberon.com>
Strange that you should ask.  This is what ElastoLab does.  ElastoLab is a
physics simulating package that allows you to design scenes with gravity, air
resistance, springs, elastics, rods, and barriers then set them in motion in
real-time.  It's a low-cost application (i.e., about $30 US) I'm about to
release within the next few months.  Unfortunately for POV users, it works only
in 2D and it doesn't output coordinates to import into POV-Ray.  Writing
coordinates may be added in future versions.  I don't forsee writing a 3D
interface for it.

In a nutshell, you need to implement something called a differential equation
solver.  One technique (which is not very good) is to use Euler's Method.
Basically, you calculate all the forces at any point in time.  Gravity would be
F=mg, springs are F= -kd, air resistance is F= -cv where c is the air resistance
constant. From the forces you can calculate the accelerations of the particles
(a=F/m). From the accelerations you can calculate the velocities (v2=v1 + at
where t is the time increment) and from the velocities you can calculate the new
positions (p2=p1 + vt).  Then you recalculate the forces and do it all again.

A better way (used by ElastoLab) is Adaptive Runge-Kutta but that technique goes
well beyond what I can explain in a simple email.

When ElastoLab is ready for a public beta, I'll let you know and you can try it.

David Buck
dav### [at] simberoncom

Andy Cocker wrote:

> Is anybody actively working on equipping POV with collision-detection, and
> real-world physical behaviour to objects? I understand that Chris Colefax is
> holding off on his work until POV 3.5 is released (am I correct on this?).
>
> I am asking simply because I have long wished for the capability of
> animating objects simply by defining their characteristics (mass, elasticity
> etc), and letting POV do the rest, but there is no way that I could even
> begin to code this myself. I honestly wouldn't know where to start.
>
> I gather there are internal shortcomings regarding the detection of an
> objects extremeties (am I correct on this also?), but can these be overcome?
> How does other software (proprietary in house animation software in
> particular) achieve this?
>
> Apologies if you think this should have been posted in povray.advanced-users
>
> --
> Andy Cocker
>
> ---------------------------------------------------------------
> listen to my music at:
> www.mp3.com/lunarland
> ---------------------------------------------------------------
>
> 'I spilled spot remover on my dog. He's gone now. '
> 'I went to a restaurant that serves "breakfast at any time."
> So I ordered french toast during the Renaissance. '
>
>  - Steven Wright.
> ---------------------------------------------------------------


Post a reply to this message

From: Andy Cocker
Subject: Re: Physics - collision detection etc
Date: 25 Jan 2001 16:59:47
Message: <3a70a1d3$1@news.povray.org>
Thankyou David. that would be great.

--
Andy Cocker

---------------------------------------------------------------
listen to my music at:
www.mp3.com/lunarland
---------------------------------------------------------------

'I spilled spot remover on my dog. He's gone now. '
'I went to a restaurant that serves "breakfast at any time."
So I ordered french toast during the Renaissance. '

 - Steven Wright.
---------------------------------------------------------------


Post a reply to this message

From: John VanSickle
Subject: Re: Physics - collision detection etc
Date: 26 Jan 2001 03:03:16
Message: <3A7144AE.BC7AC38@hotmail.com>
David Buck wrote:
> 
> In a nutshell, you need to implement something called a differential
> equation solver.

I have been nurturing the idea of developing some Laplace transform
macros for POV-Ray.  Definitely not a project for the timid, or the
math-impaired.

> One technique (which is not very good) is to use Euler's Method.
> Basically, you calculate all the forces at any point in time.  Gravity
> would be F=mg, springs are F= -kd, air resistance is F= -cv where c is
> the air resistance constant. From the forces you can calculate the
> accelerations of the particles (a=F/m). From the accelerations you can
> calculate the velocities (v2=v1 + at where t is the time increment) and
> from the velocities you can calculate the new positions (p2=p1 + vt).

Let me point out here that re-calculating the new position first, with the
formula P' = P + Vt + At^2/2 yields less inaccurate results.  This still
results in an accumulating degree of imprecision; modifying the equations
to include third-order behavior reduces the imprecision; a bit of drag
(the cV factor you mention above) will reduce the wild thrashing that can
result from the accumulating errors.

> Then you recalculate the forces and do it all again.
> 
> A better way (used by ElastoLab) is Adaptive Runge-Kutta but that
> technique goes well beyond what I can explain in a simple email.

For those interested, feed "Runge-Kutta" into your friendly
neighborhood search engine.  Google registers over 3000 hits.

Regards,
John


Post a reply to this message

From: David Buck
Subject: Re: Physics - collision detection etc
Date: 26 Jan 2001 05:48:33
Message: <3A71566B.CE8EDC4E@simberon.com>
John VanSickle wrote:

> Let me point out here that re-calculating the new position first, with the
> formula P' = P + Vt + At^2/2 yields less inaccurate results.  This still
> results in an accumulating degree of imprecision; modifying the equations
> to include third-order behavior reduces the imprecision; a bit of drag
> (the cV factor you mention above) will reduce the wild thrashing that can
> result from the accumulating errors.
>

Never implement undampened springs.  They will explode with small accumulating
errors.

> For those interested, feed "Runge-Kutta" into your friendly
> neighborhood search engine.  Google registers over 3000 hits.

Tough parts are collision detection (especially particle-particle collision),
continuous contact, and rigid bodies (requires calculating center of mass,
torques and 3D orientations).

David Buck
dav### [at] simberoncom


Post a reply to this message

From: Michael Brown
Subject: Re: Physics - collision detection etc
Date: 26 Jan 2001 21:55:18
Message: <3a723896@news.povray.org>
> Never implement undampened springs.  They will explode with small
accumulating
> errors.
Or undamped pendulums. My Newton's cradle (virtual) managed to clock up
speeds of several thousand meters per second after running it for a while :)


Post a reply to this message

From: Andy Cocker
Subject: Re: Physics - collision detection etc
Date: 27 Jan 2001 18:28:45
Message: <3a7359ad@news.povray.org>
I've just been looking at www.havok.com... WOW! Solid body dynamics, cloth
simulation.. available as a MAX plugin. *This* is the kind of thing I want
access to in POV :-)

I couldn't do it, but could any of you math wizards that frequent these
newsgroups? I hope so..
--
Andy Cocker

---------------------------------------------------------------
listen to my music at:
www.mp3.com/lunarland
---------------------------------------------------------------

'I spilled spot remover on my dog. He's gone now. '
'I went to a restaurant that serves "breakfast at any time."
So I ordered french toast during the Renaissance. '

 - Steven Wright.
---------------------------------------------------------------


Post a reply to this message

From: Andy Cocker
Subject: Re: Physics - collision detection etc
Date: 27 Jan 2001 19:02:44
Message: <3a7361a4@news.povray.org>
I just wanted to mention this demo, from the HAVOK website. It's a win
executable of the real-time dynamic behaviour of falling blocks that you can
interract with. Runs fine on my P200.

http://www.havok.com/download/blocks.zip

--
Andy Cocker

---------------------------------------------------------------
listen to my music at:
www.mp3.com/lunarland
---------------------------------------------------------------

'I spilled spot remover on my dog. He's gone now. '
'I went to a restaurant that serves "breakfast at any time."
So I ordered french toast during the Renaissance. '

 - Steven Wright.
---------------------------------------------------------------


Post a reply to this message

From: Michael Brown
Subject: Re: Physics - collision detection etc
Date: 28 Jan 2001 00:37:00
Message: <3a73affc$1@news.povray.org>
Maybe we should start a joint project with the sci.physics newsgroup :)

"Andy Cocker" <big### [at] mariner9fsnetcouk> wrote in message
news:3a7359ad@news.povray.org...
> I've just been looking at www.havok.com... WOW! Solid body dynamics, cloth
> simulation.. available as a MAX plugin. *This* is the kind of thing I want
> access to in POV :-)
>
> I couldn't do it, but could any of you math wizards that frequent these
> newsgroups? I hope so..
> --
> Andy Cocker
>
> ---------------------------------------------------------------
> listen to my music at:
> www.mp3.com/lunarland
> ---------------------------------------------------------------
>
> 'I spilled spot remover on my dog. He's gone now. '
> 'I went to a restaurant that serves "breakfast at any time."
> So I ordered french toast during the Renaissance. '
>
>  - Steven Wright.
> ---------------------------------------------------------------
>
>


Post a reply to this message

From: Andy Cocker
Subject: Re: Physics - collision detection etc
Date: 28 Jan 2001 09:54:46
Message: <3a7432b6@news.povray.org>
"Michael Brown" <emb### [at] i4freeDELETETHISconz> wrote in message
news:3a73affc$1@news.povray.org...
> Maybe we should start a joint project with the sci.physics newsgroup :)

Well, I honestly do think that it would be a fantastic addition to POV..
this in conjunction with POV's scripting language would be ever so powerful.
I'm sure it will happen eventually... :-)

--
Andy Cocker

---------------------------------------------------------------
listen to my music at:
www.mp3.com/lunarland
---------------------------------------------------------------

'I spilled spot remover on my dog. He's gone now. '
'I went to a restaurant that serves "breakfast at any time."
So I ordered french toast during the Renaissance. '

 - Steven Wright.
---------------------------------------------------------------


Post a reply to this message

Goto Latest 10 Messages Next 8 Messages >>>

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