POV-Ray : Newsgroups : povray.general : spline question Server Time
5 Nov 2024 03:18:19 EST (-0500)
  spline question (Message 1 to 4 of 4)  
From: J T
Subject: spline question
Date: 10 Aug 2003 11:39:13
Message: <oprto4gdzg7d64w7@news.povray.org>
Hi,

I am using a spline, with randomly generated points. I use a while loop for 
placing spheres on the points of the spline. I want to set the first point 
of the spline myself, instead of randomly generated. How can I do that? I 
tried the following:

spline {
 natural_spline
  0,MyPoint
  // ...here is the code for the randomgenerator...
 }

But that doesn't work. First the randomgenerator and then my point didn't 
work either.


Thank you very much for your help!

J T


Post a reply to this message

From: gonzo
Subject: Re: spline question
Date: 10 Aug 2003 16:43:22
Message: <3f36ae6a@news.povray.org>
J T <jte### [at] chellonl> wrote in message
news:oprto4gdzg7d64w7@news.povray.org...
> Hi,
>
> I am using a spline, with randomly generated points. I use a while loop
for
> placing spheres on the points of the spline. I want to set the first point
> of the spline myself, instead of randomly generated. How can I do that? I
> tried the following:
>
> spline {
>  natural_spline
>   0,MyPoint
>   // ...here is the code for the randomgenerator...
>  }
>
> But that doesn't work. First the randomgenerator and then my point didn't
> work either.
>

I don't think you can have the generator code within the spline definition.
I did something like that & I had to declare ;
    array points[num_points] { my_point, ,,(fill rest of array with
randomgenerator),, }

Then build the spline from the array;
    spline {
        natural_spline
         0, points[0], points[1], ,,(on out to num_points...)
    }

RG


Post a reply to this message

From: Christopher James Huff
Subject: Re: spline question
Date: 16 Aug 2003 10:57:53
Message: <cjameshuff-619924.09545116082003@netplex.aussie.org>
In article <oprto4gdzg7d64w7@news.povray.org>,
 J T <jte### [at] chellonl> wrote:

> spline {
>  natural_spline
>   0,MyPoint
>   // ...here is the code for the randomgenerator...
>  }
> 
> But that doesn't work. First the randomgenerator and then my point didn't 
> work either.

Put a comma after MyPoint? If that doesn't work...what is the code 
you're using for the random point generator?

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: gonzo
Subject: Re: spline question
Date: 25 Aug 2003 14:25:01
Message: <web.3f4a53c15792ee8aa0c272b50@news.povray.org>
Christopher James Huff wrote:
>In article <oprto4gdzg7d64w7[at]news.povray.org>,

>Put a comma after MyPoint? If that doesn't work...what is the code
>you're using for the random point generator?
>


Yeah, it does work!

I had to generate random points before and always got an error about some
code found where some value was expected, so I just figured that a spline
didn't like to see code in the definition.

This post made me go back and play around with it some more.  Don't know
what I was doing before, but it works fine now!

RG  -  yet another question answered that I didn't ask


Post a reply to this message

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