|
![](/i/fill.gif) |
Leo80s wrote:
>>There's some info on using arrays in isosurface functions here:
>>
>>http://www.econym.demon.co.uk/isotut/arrays.htm
>
> Reading this page my question is:
>
> In your opinion, in which manner I can estimate a "reasonably small number
> of elements" for an array?
Instead of continuing this 'game of cat and mouse' with helpful people
having to guess what you need, maybe you could just say what your _goal_
(what do you want to create???) is rather than asking extremely specific
questions?
Looking at this whole thread, I get the impression you are trying to do
something with isosurfaces that they are simply not suitable for: What you
have to understand is that isosurfaces work best with continuous functions
due to the method used to render them (that is, the function has to be
solved). As such, introducing large amounts of discrete values will require
extreme settings to always get an artifact free rendering of isosurfaces.
Depending on your goal, there might actually be more suitable ways to create
the geometry you desire with POV-Ray. But only if you let people know about
your goal you will ever get broader, and ultimately more helpful suggestions.
Thorsten Froehlich, POV-Team
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
Wasn't it Leo80s who wrote:
>> There's some info on using arrays in isosurface functions here:
>>
>> http://www.econym.demon.co.uk/isotut/arrays.htm
>
>Reading this page my question is:
>
>In your opinion, in which manner I can estimate a "reasonably small number
>of elements" for an array?
It's really up to you. Just be aware that indexing N elements requires a
minimum of N-1 "select" statements. The example on that page shows an
8-element array being indexed with 7 "select"s.
I suppose you could write an external program that would generate the
POV SDL code for as many elements as you like, or you could write those
N-1 select statements by hand. I suspect that it may not be possible to
generate the selects with a POV macro.
It's really not worth the bother anyway, because the results are likely
to be disappointing due to the infinite gradients at the
discontinuities.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
Leo80s <nomail@nomail> wrote:
> I tried your piece of code and it works but I need to use recursion with
> element of an array...so I've modified your code in this way:
Again, you are trying to use SDL in user-defined functions, even though
I just explained that you can't do that.
You can use SDL to *build* functions, but you can't use SDL *from*
functions. In this specific case, you can't make a function which uses
an SDL array because an array is an SDL element and user-defined functions
do not support arrays.
It's a bummer, but it's just the way it works.
(There's a *reason* for it to work this way, though: Unlike the SDL,
user-defined functions are internally byte-compiled, which makes their
evaluation extremely fast. I estimate that evaluating a user-defined
function is more than 10 times faster than evaluating eg. an equivalent
#macro.)
> #declare Factorial =
> function(A) { select(A, 1, 1, w[A]*Factorial(A-1)) };
> compiling, I've obtained this error (related on w[A]):
> Parse Error: Expected 'numeric expression', undeclared identified 'A' found
> instead ...
> But why??? A is sure not initialited (but it's a parameter...) but why
> undeclared?!?!
Because in this case "A" is not SDL and the SDL parser doesn't see it.
When you make the "w[A]" call, the SDL tries to substitute that call
with its value, but it can't because A is not defined (in the SDL level).
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |