POV-Ray : Newsgroups : povray.general : Chain Question : Re: Chain Question Server Time
4 Aug 2024 22:10:48 EDT (-0400)
  Re: Chain Question  
From: Mike Williams
Date: 28 Jan 2003 13:10:36
Message: <8jzo3BAxAoN+Ewsl@econym.demon.co.uk>
Wasn't it Anthony D. Baye who wrote:
>    I'm working on several small detail objects for a set of larger
>scenes.  One of these is a rather tenchnological looking key, meant to
>hang from a chain.  My problem is that creating the chain by hand would
>be far beyond my patience and the only macro I've found for creating
>chains is for hanging a chain, rope or other such object, between two
>arbitrary points.  Such as might be found supporting a rope bridge or
>other structure.
>    Would anybody know where I could find a macro that creates a chain,
>such as one might find on a pendant or necklace, that behaves like a
>physical chain would in relation to other objects in the scene.  Or at
>least how I might go about conceptualizing such a macro, if it is at all
>possible?
>    Any thoughts or ideas would be appreciated.
>

One way to get very good results (at the expense of quite a bit of hard
work) would be to use a patched version of POV that contains a mechanics
simulator, such as the one in MegaPOV 1.0

Model the chain as a series of masses and connections which start above
the other objects in the scene. One of the masses will represent the
link to which the key is attached, and that should be made much heavier
than the other masses. All the objects that the chain will interact with
will probably need to be modelled as isosurfaces (using the IsoCSG
library if necessary). Run the simulation for a sufficient number of
frames for the motion to stop. Then, don't use MechSim_Show_All_Objects
to display the results (because then you get a set of balls and struts
instead of a chain), but obtain the position of each mass with
  #declare P[N]=mechsim:mass(N):position;
and place your links at those points.

A simpler way, but which produces inaccurate results would be to use
trace() to find out if there's a point on the underlying surface
vertically below a link and consider dropping the link down to that
point, storing the traced positions in an array. Then check each link to
see if has dropped too far below its neighbours and lift it as required.
Repeat the checking and lifting until all the links are close enough to
their neighbours.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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