POV-Ray : Newsgroups : povray.advanced-users : isosurface: Does the order of multiple functions matter? : isosurface: Does the order of multiple functions matter? Server Time
19 Jun 2024 05:36:57 EDT (-0400)
  isosurface: Does the order of multiple functions matter?  
From: Kenneth
Date: 28 Jan 2023 05:30:00
Message: <web.63d4f81d3b647a9d9b4924336e066e29@news.povray.org>
I have an isosuface made from multiple functions that is working quite nicely--
but I want to rearrange the order of the functions to see the different(?)
results. The code is complex, so I'll leave out the ugly function details and
syntax. The following is just pseudo code.

Right now, it is like this (very simplified):
function{A + B + C + D}

Only four, thankfully! :-)

Does the order of the functions matter when POV-ray evaluates them? Or are they
evaluated 'all at once' regardless of the order?

If the ordering does matter, what would be the most efficient way to set up
'switches' at the beginning of the scene to easily change the order of A,B,C and
D? Possibilities that occur to me would be some kind of combination of
#switch/#case, or #if blocks, or select(?), or maybe an array; but I want the
top-of-code selection process to be relatively easy-- something like
              #declare FUNCTION_ORDER= <C,A,D,B>;
.... and without having to make multiple copies of the functions for all of the
different permutations.

Any ideas?

(BTW: #if and #switch/#case do work well in the body of the isosurface, within
the main function, to at least eliminate certain parts. Probably not good code
practice, but it causes no problems AFAIK.)

Post a reply to this message

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