POV-Ray : Newsgroups : povray.animations : Simulating [parametric] nested loop in animation scene file. : Simulating [parametric] nested loop in animation scene file. Server Time
18 Apr 2024 19:45:50 EDT (-0400)
  Simulating [parametric] nested loop in animation scene file.  
From: Bald Eagle
Date: 19 Oct 2016 13:00:01
Message: <web.5807a583603cf4ffb488d9aa0@news.povray.org>
Hi folks,

I wanted to animate the construction of some meshes based on parametric
equations, and am grappling with how to "linearize" the SDL so that I get the
behaviour of the Theta-Phi nested loop over the linear clock sequence.

I'm guessing the easiest way would be to have Phi follow a sawtooth type
function, which would imply using mod() - but I'm getting stuck.

Here's what I've worked out so far - I'd appreciate a little help visualizing
how to formulate the specific mod() function I need for this:

=========================================================

#declare ClockStep = 0.001;

#declare T_begin = -pi;
#declare T_end = pi;
#declare T_span = T_end-T_begin;

#declare P_begin = 0;
#declare P_end = 2*pi;
#declare P_span = P_end-P_begin;
#declare P_divisions = 36;


#for (Clock, 0, 1, ClockStep)

 #declare Theta = T_begin + (Clock*T_span);

  #declare Phi = P_begin + (P_span * mod (Clock, 1/P_divisions));

  #debug concat( " Clock = ", str(Clock, 3, 3),  " Theta = ", str(Theta, 3, 3),
" Phi = ", str(Phi, 3, 3), "\n")

#end // end for Clock


Post a reply to this message

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