POV-Ray : Newsgroups : povray.text.scene-files : Pursuit curve (was Rainy Sunday afternoon) : Re: Pursuit curve (was Rainy Sunday afternoon) Server Time
29 May 2024 18:12:43 EDT (-0400)
  Re: Pursuit curve (was Rainy Sunday afternoon)  
From: William F Pokorny
Date: 2 Nov 2023 07:33:09
Message: <654388f5$1@news.povray.org>
On 11/2/23 02:40, kurtz le pirate wrote:
> Last remark. To reduce the hue between 0 and 360, I use my "mod2"
> function, which ALWAYS returns a positive value.
> #declare mod2 = function (x,y) { select(mod(x,y),mod(x,y)+y,mod(x,y)) }
> Too many troubles with the standard mod() function ...

Thanks! I've made your updates and done a couple, hsb2rgb vs CHSV2RGB, 
image compares. I too see the results matching perfectly.

Your mod2 function is a good candidate to make an inbuilt parser 
function. I've already implemented an inbuilt function in my fork called 
f_npmod which matches the internal pattern mechanism's version of:

[0, n] = {x | 0 <= x <= n}  (n == 1 always inside the pattern mechanism)

rather than mod's usual:

[0, n) = {x | 0 <= x < n}

and there is perhaps a place for a fourth form I suppose which would 
functionally be a combination of both mod2 and f_npmod.

The color manipulation macros like hsb2rgb() - traditionally in 
colors.inc - I see as better existing in an include called 
color_manipulations.inc (or similar) apart from any general color 

The color_manipulations.inc then being a part of a separately maintained 
'extended includes' package for my yuqk fork. Who knows though, if I'll 
ever get around to maintaining and shipping such a package.

Still, I've been capturing SDL code I think would be good as part of 
such a package though - and your implementation of hsb2rgb saved aside 
for that eventual purpose.

Bill P.

Post a reply to this message

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