POV-Ray : Newsgroups : povray.general : Equal distribution along stretched circle circumference - how to do it? : Re: Equal distribution along stretched circle circumference - how to do it? Server Time
8 Aug 2024 01:18:14 EDT (-0400)
  Re: Equal distribution along stretched circle circumference - how to do it?  
From: Chris Colefax
Date: 29 Mar 2001 18:19:26
Message: <3ac3c2fe@news.povray.org>

> As preliminary work for Terragen-like flyover animations I started to
> experiment with equal distribution of objects along a stretched circle
> curve... in my example, the x axis of the "circle" is 40, while the z
> axis is only 20 units, and I want to place 90 small spheres along its
> circumference.
>
> When using constant radial spacing, I observed that the distance between
>

> respective values at opposite positions. I assume that the change in
> radial position for each sphere to compensate this must be a cosinus
> function, something like 2.0933321+0.6973522*cos(i*4) with i going from
> 0 to 89 (number of spheres), but up to now, I just failed to implement
> this correctly into the translate statement.
>
> For better understanding of my problem, I attached the complete scene
> script; at clock=0 the oval will be rendered with constant radial
> spacing, at clock=1 I intended to do compensating radial spacing...

As others have pointed out, doing this in a mathematically exact way would
seem to be impossible.  The same is true of the functions for cubic spline
curves, as used in my Spline Macro File.  However, the file does allow even
spacing along any arbitrary cubic splines using a sampling method.  The file
also includes functions to simplying creating objects based on spline paths,
and animating objects along spline paths.  Creating circles and ellipses is
quite simple using the spline definition options (tip: a tension of -2/3
with four points gives a good circle).

You can find a full tutorial for the file and the downloadable ZIP package
here:

   http://www.geocities.com/ccolefax/spline


Post a reply to this message

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