POV-Ray : Newsgroups : povray.unofficial.patches : MegaPOV mechsim environment collisions : Re: MegaPOV mechsim environment collisions Server Time
1 Jul 2024 03:46:13 EDT (-0400)
  Re: MegaPOV mechsim environment collisions  
From: Mack Tuesday
Date: 23 May 2003 18:30:01
Message: <web.3ecea0263284c5185f597a2b0@news.povray.org>
Christoph Hormann wrote:
>
>Could you please rephrase your description in a more understandable form?
>I have no idea what 'declaring the load_file' means for example.

Sorry.  Now I see that my ramblings weren't clear.  I also
failed to mention that your work is very impressive and it's
wonderful that you have made this functionality available!  I
think I sounded overly negative in my first post and I didn't
mean to.

This is what I tried first:  I opened sim.dat before the
global_settings section and read the values out.  Now I want
the relaxed lengths of the springs to vary over time according
to a sinusoid function of this form:

C + A*sin(F*t + P)

where A is amplitude, F is frequency, P is phase, and C is some
offset to make sure the length doesn't fall below zero.  So I
updated the "length" values of the connections for the current
frame.  At this point I had all the data I need to explicitly
give complete "mass" and "connection" declarations in the
topology section.  So my topology section *didn't* look like this:

topology {
  ...stuff...
  #if (clock = 0)
  ...stuff...
  #else
    load_file "mechsim.dat"
  #end
  save_file "mechsim.dat"
}

Rather, it looked like this:

topology {
  ...stuff...
  #declare i = 0;
  #while (i < NumMasses)
    mass { ...stuff... }
    #declare i = i + 1;
  #end
  #declare i = 0;
  #while (i < NumConnections)
    connection { ...stuff... }
  #end
  save_file "mechsim.dat"
}

So I explicitly declared my masses and connections instead
of declaring a load_file, regardless of the clock value.
This approach led to the masses falling straight through
the environment.

This is what I tried next:  I changed the topology section
to look like this:

topology {
  ...stuff...
  load_file "mechsim1.dat"
  save_file "mechsim2.dat"
}

Before the global_settings section, I opened mechsim2.dat,
read in the values, and updated the length values just like
before.  This time, however, I wrote the values back into
the other file, mechsim1.dat, and forced the simulator to
open mechsim1.dat itself to get the values.  This works
much better but some of the masses still often end up
completely submerged under the surface of the environment.

I'll look at the documentation again but I reviewed it many
times to see what I might have missed.  I'll try increasing
the environment stiffness even more to see if that helps.

>
>Which of the sample scenes are you referring to?
>

I was talking about the one where the long grid falls on
top of the big block.  I think it's example number 5.


Post a reply to this message

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