POV-Ray : Newsgroups : povray.binaries.animations : Gel simulation : Re: Gel simulation Server Time
20 Jul 2024 03:27:03 EDT (-0400)
  Re: Gel simulation  
From: Redbeard (MDJohnson)
Date: 8 Oct 2001 19:21:31
Message: <3bc234fb$1@news.povray.org>
"Greg M. Johnson" <"gregj56590[:-0]"@aol.com> wrote in message
news:3BC1CC2C.BDA9C228@aol.com...
> Cool.  Will be interested in the algo.  When I've tried things like this, I
have the
> hardest time with what to do when the object slows to a stop-- it always fell
> through my surface....
>

I've been using Hugo Elias' page (http://freespace.virgin.net/hugo.elias/) as a
reference for my simulations.  He's got some pretty good info, and if you like
to explore he doesn't give you *too* much.

Basically, this is a 3-D cloth.  Each element is connected to it's 26 nearest
neighbors (or less if at the edges) with a spring and you figure out how far to
move each element based on how far the spring is stretched.

As for falling through the surface - I'm cheating right now.  If the
y-coordinate is less than 0 + radius of element, it's forced to that value.
When I start adding the ability to bounce off of surfaces I'll have to start
using trace and being *very* careful.  Otherwise it *would* be possible to fall
through the surface.  In this case, the surface is a plane, and if the gel is
falling too fast (or an element is) it might pass right through the plane and
miss the trace check.  I imagine that's the problem a lot of the particle/water
simulations have.

When I get it done, you'll be able to specify the gel size on creation,
springiness, particle mass (for each point :-) as well as extra forces, etc.

Right now the mechanism is a little flaky, but it's not file dependent or clock
step dependent.  However, to speed up renders it can use a file between frames
(and it still doesn't affect the animation... clock 0.5 yields the same results
either way - in theory)

Now I'm probably rambling because I'm so happy with this thing... so I'll get on
and reply to some others :-)  And I hope the stack fault bug gets fixed quick
:-)

Michael
--
#macro M(D)#local J=strlen(D);#local _=""#while(J>0)#local _=concat(_,substr(D
,J,1))#local J=J-1;#end _#end sphere{z*9,5pigment{rgb x}}#macro N(D,J)text{ttf
"timrom.ttf"M(D)1,0 translate-J}#end#macro O(E,K)#local _=N(E,K)light_source{-
z*9rgb 1projected_through{_}}#end O("leahciM"<1.6,-.3.9>)O("nosnhoJ"<1.6.9.9>)


Post a reply to this message

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