POV-Ray : Newsgroups : povray.advanced-users : Animating spline vertices in a sphere sweep? Server Time
26 Dec 2024 09:19:28 EST (-0500)
  Animating spline vertices in a sphere sweep? (Message 1 to 2 of 2)  
From: Mike
Subject: Animating spline vertices in a sphere sweep?
Date: 21 Mar 2006 20:35:00
Message: <web.4420a93d2893096649a12b420@news.povray.org>
Has anyone ever tried to do the following?

sphere_sweep {
        cubic_spline
             4 , // Num_of_spheres
             #if (clock > 0.25) < 50 , 50 , 50 >, 8 #end
             #if (clock > 0.5) < 50 , 60 , 50 >, 8 #end
             #if (clock > 0.75) < 50 , 50 , 90 >, 8 #end
             #if (clock > 0.9) < 50 , 40 , 50 >, 8 #end
             texture {
               pigment { color Red }
               }
        }

I keep getting an error where povray expects a number expression and finds
the texture { instead. I think its related to the number of spheres
changing dynamically with the clock? Any suggestions? I would really prefer
to use a sphere sweep.

As always, much thanks!

-mike


Post a reply to this message

From: Mike Williams
Subject: Re: Animating spline vertices in a sphere sweep?
Date: 21 Mar 2006 22:01:26
Message: <4M3tsEAA4LIEFwcf@econym.demon.co.uk>
Wasn't it Mike who wrote:
>Has anyone ever tried to do the following?
>
>sphere_sweep {
>        cubic_spline
>             4 , // Num_of_spheres
>             #if (clock > 0.25) < 50 , 50 , 50 >, 8 #end
>             #if (clock > 0.5) < 50 , 60 , 50 >, 8 #end
>             #if (clock > 0.75) < 50 , 50 , 90 >, 8 #end
>             #if (clock > 0.9) < 50 , 40 , 50 >, 8 #end
>             texture {
>               pigment { color Red }
>               }
>        }
>
>I keep getting an error where povray expects a number expression and finds
>the texture { instead. I think its related to the number of spheres
>changing dynamically with the clock? Any suggestions? I would really prefer
>to use a sphere sweep.

The Num_of_spheres has to agree with the number of spheres.

When the clock has value 0.0, then your code evaluates to

sphere_sweep {
        cubic_spline
             4 , // Num_of_spheres
             texture {
               pigment { color Red }
               }
        } 

Num_of_spheres is still set to 4, but there are 0 spheres.

A cubic_spline with zero spheres isn't going to parse anyway. The
minimum is 4.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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