|
|
Denis Corbin wrote:
> Hi Greg,
>
> nice animation, but a lot of questions arise !
>
> But OK, I've selected only one question :
>
> In your animation, what is the link between the surface and the position
> of the spheres ? Well in other words, how do you know the height (z) of
> the surface at a given (x,y) point ?
You need x,y,z at any given point AND the normal of the surface.
Here's the algorithm in a nutshell. Yes, it requires the mega pov patch. First I
define my Surface as an isosurface (I never liked heightfields (;-p ).
1. Particles have a starting velocity in x & z. and a starting position in x & z.
2. A trace function is called for the "new place".
#declare Downthere=trace(Surface,Oldplace+0.10*Oldvelocity+1000*y, -y, Norm);
3. The velocity is modified by adding the x and z components of the NORMAL of the
surface at the new place.
#declare Newvelocity=Oldvelocity+<Norm.x,0,Norm.z>;
4. The new place is modified by adding the NORMAL of the surface times the radius
of the ball.
#declare Placetostore=Downthere+Norm*ballradius;
Then I store the Placetostore for each ball.
Post a reply to this message
|
|