POV-Ray : Newsgroups : povray.general : Call for assistance Server Time
8 Apr 2025 17:23:29 EDT (-0400)
  Call for assistance (Message 1 to 4 of 4)  
From: Bald Eagle
Subject: Call for assistance
Date: 1 Apr 2025 12:50:00
Message: <web.67ec18792720341da911b6e125979125@news.povray.org>
So, as those playing from home know:

I am collecting all of the various functions, macros, small scenes, tricks,
tools, etc. into one place to serve as a master library / to-do list for
developing useful tools for new users and experienced alike, in order to make
SDL more useable and identify and highlight where features, syntax, and inbuilt
versions of externally included code would be desirable in POV-Ray 4.0.

Yesterday I went hunting for my bitwise operator macros, and number-base
conversion macros.
I am unable to find them. (which is weird)

I also distinctly recall coding an XOR pattern, yet I can find no image post on
these newsgroups for that.  Nor can I find a scene file or rendered image in any
of my directories.  :O
Does anyone recall that?  Can you find that thread?

I think we ought to have a thread on things like this that we can recall, but
we're unable to find (the sources) . . .

- The render of the SDL text file with keyword highlighting
- The gorgeous rotating stone pyramid with SSLT


Anyway, as I was thinking about the XOR pattern, it's apparent that I didn't
make that as a pigment {function}} since I'm pretty sure all I wrote were
macros.

In order to do that, I'd need to convert the fractional decimal values of the
unit square to binary values, and then perform an XOR on the results of x and y.

But I can't do loops in functions.
Or CAN I . . .

I figure that if I declare a function with two arguments - the number I want to
convert, and a counter, then I can make it a recursive function, and decrement
the counter until it hits 0.  then I can use select () to either return the
(binary) result of the last digit (which is all I need), or do another round.

I'm currently in the middle of other things, and have no access to a functional
POV-Ray parser to test the code, but I was wondering if this would work:

#declare D2B = function (digits, num) {
select (digits, 0, mod(num*2,1),
D2B (digits-1, floor(mod(num*2,1)))
)
}

#declare XOR = function (A, B) {select (A-B, 1, 0, 1)}

#declare Pattern = function {XOR (D2B(mod(x,1)), D2B(mod(y,1)))}

plane {z, 0 pigment {function {Pattern (x,y,z)}}}

Thanks for any help, rewriting, debugging, and test renders.
(and yes, mod in Pattern ought to be replaced with an fmod () that behaves
across the -N, 0, +N transition )

- BW


Post a reply to this message

From: jr
Subject: Re: Call for assistance
Date: 1 Apr 2025 13:05:00
Message: <web.67ec1c1b6818bc53721a48e56cde94f1@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> ...
> Yesterday I went hunting for my bitwise operator macros, and number-base
> conversion macros.
> I am unable to find them. (which is weird)
>
> I also distinctly recall coding an XOR pattern, yet I can find no image post on
> these newsgroups for that.  Nor can I find a scene file or rendered image in any
> of my directories.  :O
> Does anyone recall that?  Can you find that thread?

I recall
<https://news.povray.org/povray.advanced-users/thread/%3Cweb.5d5e31263b86496a3936914a0%40news.povray.org%3E/>


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Call for assistance
Date: 1 Apr 2025 13:15:00
Message: <web.67ec1e296818bc53a911b6e125979125@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> I recall
>
<https://news.povray.org/povray.advanced-users/thread/%3Cweb.5d5e31263b86496a3936914a0%40news.povray.org%3E/>
>
>
> regards, jr.

Yeah - I've read that same thread at least 10 times in the course of searching
for all manner of things.  I just find it really strange that I don't find much
of what I'm looking for when I try to search for xor, bitwise, etc.

I could have sworn that it was a few years ago, clipka might have chimed in...

.. . . or it was all just another fever dream from not enough quinine in my gin &
tonics.  :\

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: Call for assistance
Date: 1 Apr 2025 20:10:00
Message: <web.67ec7fde6818bc531f9dae3025979125@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> I also distinctly recall coding an XOR pattern, yet I can find no image post on
> these newsgroups for that.  Nor can I find a scene file or rendered image in any
> of my directories.  :O
> Does anyone recall that?  Can you find that thread?

Aha!
I KNEW that I got this pattern to work.
I guess somehow I just never posted it?

Anyway, here's at least one thing on the list - the xor pattern.
It was in my first file of mathematical patterns.

I'll have to keep digging around to see if I can find some of the other stuff.


Post a reply to this message


Attachments:
Download 'mathpatterns1.png' (122 KB)

Preview of image 'mathpatterns1.png'
mathpatterns1.png


 

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