POV-Ray : Newsgroups : povray.newusers : Problem with a sphere_sweep in a animation : Re: Problem with a sphere_sweep in a animation Server Time
29 Jul 2024 04:26:32 EDT (-0400)
  Re: Problem with a sphere_sweep in a animation  
From: Tim Attwood
Date: 28 Sep 2006 02:30:45
Message: <451b6c15@news.povray.org>
> I want to create an animation, where the number of points in sphere_sweep 
> is
> the same as the frame_number. For example POV-Ray is rendering frame 
> number
> 5, the sphere_sweep also have 5 points and when he's rendering frame 
> number
> 6, the same sphere_sweep as before have also 6 points.

sphere_sweep can have bugs in the rendering, places that look wrong.
So I prefer to use a macro, and a spline... the 4th value is the radius.

#macro Sweep(SPL, from, to, rez)
 #local eval_to = to;
 #local C = from;
 sphere {<SPL(C).x,SPL(C).y,SPL(C).z>,SPL(C).t}
 #while (C<eval_to-rez)
  cone {<SPL(C).x,SPL(C).y,SPL(C).z>,SPL(C).t,
  <SPL(C+rez).x,SPL(C+rez).y,SPL(C+rez).z>,SPL(C+rez).t}
  sphere {<SPL(C+rez).x,SPL(C+rez).y,SPL(C+rez).z>,
    SPL(C+rez).t}
  #local C=C+rez;
 #end
#end

#declare path = spline {
   natural_spline
   -0.25, <0,0,0, 0.01>
    0.00, <0.2,0,0.2, 0.01>
    0.25, <0,0,0.4, 0.05>
    0.50, <-0.2,0,0.6, 0.1>
    0.75, <0,0,0.8, 0.05>
    1.00, <0.2,0,1, 0.05>
    1.25, <0,0,1.2, 0.05>
};

union {
   Sweep(path, 0, clock, 0.01)
   pigment {Red}
}


Post a reply to this message

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