POV-Ray : Newsgroups : povray.newusers : Problem with a sphere_sweep in a animation Server Time
1 Nov 2024 01:21:22 EDT (-0400)
  Problem with a sphere_sweep in a animation (Message 1 to 3 of 3)  
From: MSAB
Subject: Problem with a sphere_sweep in a animation
Date: 27 Sep 2006 13:10:00
Message: <web.451aadcbb83d93a9500086120@news.povray.org>
Moin,
my English isn't the best, so I hope you can understand me...

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.

The only idea I had, was to use many if-comments, but that's of course not
very good:

sphere_sweep {
  linear_spline
  frame_number+1,
  first_point,R,
  first_point,R
  #if (frame_number = 2) ,second_point,R #end
  #if (frame_number = 3) ,third_point,R #end
  #if (frame_number = 4) ,forth_point,R #end
  etc...
}

Is there a easier way, to make that, maybe with an array or something other?
Please help me...


Post a reply to this message

From: Manuel Mata
Subject: Re: Problem with a sphere_sweep in a animation
Date: 28 Sep 2006 02:25:00
Message: <web.451b6a0e1693327fd141b3240@news.povray.org>
You can set the clock variable the same as the frame number. For example:

initial_clock = 0;
final_clock = 10;

initial_frame_number = 0;
final_frame_number = 10;

This way the clock variable will have always the frame number so you can set
it on the sphere_sweep.

I dont remember if those are the right syntax, but you can read the docs
instead.

See ya.

           Manuel Mata
           www.mmata.org


Post a reply to this message

From: Tim Attwood
Subject: Re: Problem with a sphere_sweep in a animation
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.