POV-Ray : Newsgroups : povray.general : Physics - collision detection etc : Re: Physics - collision detection etc Server Time
8 Aug 2024 08:12:39 EDT (-0400)
  Re: Physics - collision detection etc  
From: David Buck
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

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