|
|
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
|
|