POV-Ray : Newsgroups : povray.advanced-users : The Menger Sponge Conundrum : Re: The Menger Sponge Conundrum Server Time
27 Jun 2024 14:33:56 EDT (-0400)
  Re: The Menger Sponge Conundrum  
From: Christian Froeschlin
Date: 14 Dec 2010 15:36:12
Message: <4d07d53c@news.povray.org>
Are you sure you posted the entire select statement?

Unless the KIFS macro is even more advanced (or convoluted?)
than it appears, the commas and parantheses don't quite seem
to match up.

Under the assumption that

   y=scale*y-CY*(scale-1);

corresponds to

   y*Scale-CY*(Scale-1),

I'd expect

   z=scale*z;
   if(z>0.5*CZ*(scale-1)) z-=CZ*(scale-1);

to correspond to something like

   select(0.5*CZ*(Scale-1)-Scale*z,Scale*z-CZ*(Scale-1),Scale*z)

which seems indeed to be identical to what you posted
except for the excluded last Scale*z part. There is of
course also the possiblity that the OP accidentally
posted a wrong version of the source code.

> Perhaps my question is better asked elsewhere, or nowhere. I can't 
> possibly expect someone to look through my code base... but I was hoping 
> for a little insight. I've tried all the obvious things already :/

well ... although you sometimes deprecate your own technical
knowledge you are actually one of the masters and I don't think
there are that many people here who can actually understand your
code without investing a significant amount of time to read up
on all the theory first (I played around with your code for a
while and am still not quite sure what it does, although I
allegedly should have a math degree lying around somewhere).


Post a reply to this message

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