/************************************************************************* AUTOMATIC CLOCK MODIFIER MACRO FILE FOR PERSISTENCE OF VISION 3.1 ************************************************************************** Created by Chris Colefax, 7 August 1998 NOTE: This file requires that ClockMod.inc be installed See "ClockMod.htm" for more information. *************************************************************************/ #if (version < 3.1) #warning "The Automatic Clock Modifier requires POV-Ray 3.1 or later!\r\n" #else #local _CM_tempver3 = version; #version 3.1; // GENERAL MACROS // ************** #macro Using (_CM_clocktype, _CM_clockstrength, _CM_clockrepeat, _CM_clockcombine) #if (strlen(_CM_clocktype) > 0) #declare clock_type = _CM_clocktype #end #declare clock_strength = _CM_clockstrength; #if (_CM_clockrepeat <= 0) #ifdef (clock_repeat) #undef clock_repeat #end #else #declare clock_repeat = _CM_clockrepeat; #end #if (strlen(_CM_clockcombine) = 0) #ifdef (clock_combine) #undef clock_combine #end #else #declare clock_combine = _CM_clockcombine #end #end #macro Preview_Clock (_CM_clocktype, _CM_clockstrength, _CM_clockrepeat, _CM_clockcombine) #if (strlen(_CM_clocktype) > 0) #local clock_type = _CM_clocktype #end #local clock_strength = _CM_clockstrength; #if (_CM_clockrepeat > 0) #local clock_repeat = _CM_clockrepeat; #end #if (strlen(_CM_clockcombine) > 0) #local clock_combine = _CM_clockcombine #end #include "ClockP.inc" #end #macro _CM_undefoptions () #ifdef (clock_type) #undef clock_type #end #ifdef (clock_strength) #undef clock_strength #end #ifdef (clock_repeat) #undef clock_repeat #end #ifdef (clock_combine) #undef clock_combine #end #end // MACROS TO INTERPOLATE BETWEEN FLOAT, VECTOR, AND COLOR VALUES // ************************************************************* #macro From (_CM_start, _CM_first_value) _CM_undefoptions () #declare clock_start = _CM_start; _CM_first_value #ifdef (_CM_current_value) #undef _CM_current_value #end #declare _CM_current_value = _CM_first_value; #end #macro To (_CM_finish, _CM_next_value) #ifndef (_CM_current_value) #declare _CM_current_value = _CM_next_value; #end #local clock_finish = _CM_finish; #local _CM_macro = true; #include "ClockMod.inc" #undef _CM_macro #local _CM_ivalue = (mclock * (_CM_next_value - _CM_current_value)); + _CM_ivalue #declare clock_start = clock_finish; #local _CM_ivalue = _CM_current_value + _CM_ivalue; #undef _CM_current_value #declare _CM_current_value = _CM_ivalue; #end #macro To_Using (_CM_finish, _CM_next_value, _CM_clocktype) #if (strlen(_CM_clocktype) > 0) #declare clock_type = _CM_clocktype #end To (_CM_finish, _CM_next_value) #end // MACROS TO INTERPOLATE BETWEEN DECLARED VALUES // ********************************************* #macro Declare_From (_CM_var, _CM_start) _CM_undefoptions () #declare clock_start = _CM_start; #end #macro Declare_To (_CM_var, _CM_finish, _CM_next_value) #local clock_finish = _CM_finish; #local _CM_macro = true; #include "ClockMod.inc" #undef _CM_macro #declare _CM_var = _CM_var + (mclock * (_CM_next_value - _CM_var)); #declare clock_start = clock_finish; #end #macro Declare_To_Using (_CM_var, _CM_finish, _CM_next_value, _CM_clocktype) #if (strlen(_CM_clocktype) > 0) #declare clock_type = _CM_clocktype #end Declare_To (_CM_var, _CM_finish, _CM_next_value) #end // MACROS TO INTERPOLATE BETWEEN MAP ENTRIES // ***************************************** #macro Map_From (_CM_start, _CM_first_entry) _CM_undefoptions () #declare clock_start = _CM_start; [1 _CM_first_entry] #ifdef (_CM_current_entry) #undef _CM_current_entry #end #declare _CM_current_entry = _CM_first_entry #end #macro Map_To (_CM_finish, _CM_next_entry) #ifdef (clock_repeat) #declare clock_repeat = int(clock_repeat); #end #local clock_finish = _CM_finish; #local _CM_macro = true; #include "ClockMod.inc" #undef _CM_macro [-mclock _CM_current_entry] [mclock _CM_next_entry] #declare clock_start = clock_finish; #if (_CM_type = 65 | _CM_type = 68 | _CM_type = 83 | _CM_type = 76) #undef _CM_current_entry #declare _CM_current_entry = _CM_next_entry #end #end #macro Map_To_Using (_CM_finish, _CM_next_entry, _CM_clocktype) #if (strlen(_CM_clocktype) > 0) #declare clock_type = _CM_clocktype #end Map_To (_CM_finish, _CM_next_entry) #end // MACROS TO INTERPOLATE BETWEEN PIGMENT MAP ENTRIES // ************************************************* #macro Pigment_From (_CM_start, _CM_first_pigment) _CM_undefoptions () #declare clock_start = _CM_start; average pigment_map {[1 _CM_first_pigment] #declare _CM_current_pigment = pigment {_CM_first_pigment} #end #macro Pigment_To (_CM_finish, _CM_next_pigment) #ifdef (clock_repeat) #declare clock_repeat = int(clock_repeat); #end #local clock_finish = _CM_finish; #local _CM_macro = true; #include "ClockMod.inc" #undef _CM_macro [-mclock _CM_current_pigment] [mclock _CM_next_pigment] #declare clock_start = clock_finish; #if (_CM_type = 65 | _CM_type = 68 | _CM_type = 83 | _CM_type = 76) #declare _CM_current_pigment = pigment {_CM_next_pigment} #end #end #macro Pigment_To_Using (_CM_finish, _CM_next_pigment, _CM_clocktype) #if (strlen(_CM_clocktype) > 0) #declare clock_type = _CM_clocktype #end Pigment_To (_CM_finish, _CM_next_pigment) #end // MACROS TO INTERPOLATE BETWEEN TEXTURE MAP ENTRIES // ************************************************* #macro Texture_From (_CM_start, _CM_first_texture) _CM_undefoptions () #declare clock_start = _CM_start; average texture_map {[1 _CM_first_texture] #declare _CM_current_texture = texture {_CM_first_texture} #end #macro Texture_To (_CM_finish, _CM_next_texture) #ifdef (clock_repeat) #declare clock_repeat = int(clock_repeat); #end #local clock_finish = _CM_finish; #local _CM_macro = true; #include "ClockMod.inc" #undef _CM_macro [-mclock _CM_current_texture] [mclock _CM_next_texture] #declare clock_start = clock_finish; #if (_CM_type = 65 | _CM_type = 68 | _CM_type = 83 | _CM_type = 76) #declare _CM_current_texture = texture {_CM_next_texture} #end #end #macro Texture_To_Using (_CM_finish, _CM_next_texture, _CM_clocktype) #if (strlen(_CM_clocktype) > 0) #declare clock_type = _CM_clocktype #end Texture_To (_CM_finish, _CM_next_texture) #end #version _CM_tempver3; #end