POV-Ray : Newsgroups : povray.binaries.tutorials : How to move an object along a particular spiral. Server Time14 Jul 2024 07:27:05 EDT (-0400)
 How to move an object along a particular spiral. (Message 1 to 5 of 5)
 From: Joe Subject: How to move an object along a particular spiral. Date: 4 Jun 2007 08:45:01 Message:
Anybody know how to move any object over the "Cornu spiral". I just started
this and I've been trying to use the parametric equations way because that
is what the spiral can be defined in. I get stuck when it comes to doing
the integrals in Pov-Ray. I don't even know if you can do integrals in
Pov-Ray. Thanks for any help. :)
 From: Grassblade Subject: Re: How to move an object along a particular spiral. Date: 4 Jun 2007 16:15:01 Message:
Of course you can do integrals in POV-ray. You can do anything with POV-ray.
*Fanatical glint in the eye*
You can obtain a numerical approximation of the integral by applying its
definition, i.e. take a very small dx, evaluate y and add dx*y to previous
sum in the loop.
You can also use the generalised hypergeometric solution, see
http://mathworld.wolfram.com/CornuSpiral.html The generalised
hypergeometric looks like a nasty customer to code, but it has the
advantage of being an exact solution.
 From: Joe Subject: Re: How to move an object along a particular spiral. Date: 4 Jun 2007 18:45:01 Message:
Is there a way to evaluate the integral with a different program, transfer
that information to a file (a txt i guess) and have Povray read it from
that text file in order to animate a path for a sphere?
 From: kurtz le pirate Subject: Re: How to move an object along a particular spiral. Date: 6 Jun 2007 14:18:27 Message:
In article <web.466495c47064b1ed998929610@news.povray.org>,
"Joe" <Pre### [at] aolcom> wrote:

> Is there a way to evaluate the integral with a different program, transfer
> that information to a file (a txt i guess) and have Povray read it from
> that text file in order to animate a path for a sphere?

hum... just a try :

x=0
y=0

for i=1 ... n
t=eval(fn)
x=cos(2.pi.t)
y=sin(2.pi.t)
sx=sum(x)
sy=sum(y)
draw point at <xs,ys>

for cornu spiral fn => i^2/321

not tested :)

--
klp
 From: Grassblade Subject: Re: How to move an object along a particular spiral. Date: 10 Jun 2007 14:20:01 Message:
"Joe" <Pre### [at] aolcom> wrote:
> Is there a way to evaluate the integral with a different program, transfer
> that information to a file (a txt i guess) and have Povray read it from
> that text file in order to animate a path for a sphere?

Yes, definitely, POV-ray can read ASCII text files, see 3.2.2.3 in the
documentation that comes with POVray (for Windows). For some reason the
same topic is numbered 2.2.2.3 in the on-line documentation:
http://www.povray.org/documentation/view/3.6.1/238/

If you make a search for "Handle" on the newsgroup, you should obtain some
really good examples of reading/writing ASCII files.