POV-Ray : Newsgroups : povray.general : Blob functions help : Re: Blob functions help Server Time
30 Jul 2024 02:20:40 EDT (-0400)
  Re: Blob functions help  
From: Tim Attwood
Date: 1 Feb 2010 08:17:23
Message: <4b66d463$1@news.povray.org>
If you have two points P1 and P2, then
the direction D of P2 from P1 is (P2-P1) normalized.

So the gravity F between P1 and P2 is
g*mass1*mass2/(distance P1 to P2)^2,
which is a real number, so you multiply
that by the direction to get a change in the
velocity of P1.  (V1=V1+F*D, P1=P1+V1*Time)

For more objects you just calculate each force and
add them onto the velocity. The real problem is this
is O(n^2) to calculate, a thousand objects would
take about a million force calculations to animate 
per frame.


Post a reply to this message

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