POV-Ray : Newsgroups : povray.general : Error - missing semicolon when using macro : Re: Error - missing semicolon when using macro Server Time
26 Apr 2024 16:45:32 EDT (-0400)
  Re: Error - missing semicolon when using macro  
From: Bald Eagle
Date: 21 Jan 2023 16:40:00
Message: <web.63cc5ac36284db5a1f9dae3025979125@news.povray.org>
Sorry - I always switch the min and max.

// converts time (in cnt) between start and complete into
// a value between 0 and 1
// (Keeping comments outside of macro saves a small amount of code parsing
//     and speeds things up depending on the number of macro calls)
#macro Subclock2 (Start, End)
 #local CurrentClock = clock;
 #local NormalizedClock = min (max ( ((CurrentClock - Start) / (End - Start)),
0), 1);

 NormalizedClock

#end // subclock2


Post a reply to this message

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