POV-Ray : Newsgroups : povray.binaries.animations : Roll-athon (455 kbbu) : Re: Roll-athon (455 kbbu) Server Time
5 Nov 2024 01:26:34 EST (-0500)
  Re: Roll-athon (455 kbbu)  
From: Greg M  Johnson
Date: 12 Jul 2000 10:40:48
Message: <396C8239.4933ABF7@my-dejanews.com>
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

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