 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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] simberon com
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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] simberon com
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Maybe we should start a joint project with the sci.physics newsgroup :)
"Andy Cocker" <big### [at] mariner9 fsnet co uk> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Michael Brown" <emb### [at] i4free DELETETHIS co nz> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
This can be really hard for some mathematical objects.
Imagine two different julia-objects colliding... How do you calculate
that?
--
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3a7434b5@news.povray.org>, Warp <war### [at] tag povray org>
wrote:
> This can be really hard for some mathematical objects.
> Imagine two different julia-objects colliding... How do you calculate
> that?
I'd probably start out by computing a bunch of points on the surface and
using the Inside test to figure out an approximate center of
gravity...but I know virtually nothing about this kind of thing, so this
is just guesswork.
Maybe limit it to mesh objects, that way you could also simulate the way
the surface is deformed by it's interactions with other objects. I don't
think the deform patch would be sufficient for this...and handling only
meshes should make it easier.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Chris Huff" <chr### [at] mac com> wrote in message
news:chrishuff-4F6740.11052728012001@news.povray.org...
> I'd probably start out by computing a bunch of points on the surface and
> using the Inside test to figure out an approximate center of
> gravity...but I know virtually nothing about this kind of thing, so this
> is just guesswork.
>
> Maybe limit it to mesh objects, that way you could also simulate the way
> the surface is deformed by it's interactions with other objects. I don't
> think the deform patch would be sufficient for this...and handling only
> meshes should make it easier.
I'd be happy with solid-body dynamics so surface deformations wouldn't be an
issue. Maybe if it was just limited to the simpler POV primitives without
CSG initially.. even just spheres, or blobs would be great too for liquid
effects.
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
David Buck wrote:
>
> Never implement undampened springs. They will explode with small
> accumulating errors.
I posted an anim to p.b.animations many moons ago, which demonstrates this.
A falling tetrahedron behaves wonderfully until about a half second after
the rebound. There was dampening, just not enough.
Modifying the motions equations to include third-order motion (ie, d3x/dt3)
greatly reduced the error, so that less dampening as needed. It's
possible that calculating the dampened sinusoid which best matches the
current velocity, acceleration, and higher derivatives will yield a closer
approximation of real motion, but I haven't looked into it very far.
And since all real-world springs are very slightly dampened anyway,
a slight dampening is needful for realism.
Regards,
John
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andy Cocker <big### [at] mariner9 fsnet co uk> wrote:
: or blobs
AFAIK blobs are also one of the most difficult primitives.
--
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Sat, 27 Jan 2001 23:28:16 -0000, "Andy Cocker"
<big### [at] mariner9 fsnet co uk> wrote:
>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..
My thesis will be (with luck) algorithms for simulating string, cloth,
solid body, gel, fluid, field and some other interesting stuff. And of
course I plan to code it as a POV patch. It should be due June or
September.
Please don't ask more. I am the one who would like it the most to see
it working.
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vip bg
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Peter Popov" <pet### [at] vip bg> wrote in message
news:223a7tg48m6a0i6jj0gon0a52k1libk95p@4ax.com...
> My thesis will be (with luck) algorithms for simulating string, cloth,
> solid body, gel, fluid, field and some other interesting stuff. And of
> course I plan to code it as a POV patch. It should be due June or
> September.
>
> Please don't ask more. I am the one who would like it the most to see
> it working.
Good luck with it Peter.
--
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
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
You could get away with using some sort of "bounding box" coding (similar to
what is used to calculate collision detection in many video games) to
envelope complex objects (like the julias mentioned earlier) in a shape that
was transparent to the camera that adopted the original object's properties
(gravity, etc.) and much faster to operate with, say a rough mesh or even
simple primatives.
This wouldn't fool the eye under very close inspection but for a camera
perspective that didn't percieve great detail it would probably work.
"Chris Huff" <chr### [at] mac com> wrote in message
news:chrishuff-4F6740.11052728012001@news.povray.org...
> In article <3a7434b5@news.povray.org>, Warp <war### [at] tag povray org>
> wrote:
>
> > This can be really hard for some mathematical objects.
> > Imagine two different julia-objects colliding... How do you calculate
> > that?
>
> I'd probably start out by computing a bunch of points on the surface and
> using the Inside test to figure out an approximate center of
> gravity...but I know virtually nothing about this kind of thing, so this
> is just guesswork.
>
> Maybe limit it to mesh objects, that way you could also simulate the way
> the surface is deformed by it's interactions with other objects. I don't
> think the deform patch would be sufficient for this...and handling only
> meshes should make it easier.
>
> --
> Christopher James Huff
> Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
> TAG: chr### [at] tag povray org, http://tag.povray.org/
>
> <><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |