POV-Ray : Newsgroups : povray.documentation.inbuilt : Mysterious function argument : Re: Mysterious function argument Server Time
25 Apr 2024 07:36:16 EDT (-0400)
  Re: Mysterious function argument  
From: Kenneth
Date: 1 Oct 2021 15:15:00
Message: <web.61575dc63ec630374cef624e6e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:
>
> I'm forever trying to do things like:
> #declare F0 = function {pattern {bozo}}
>
> and then do something like F0 (x+1, y/2, z)
>
> or F0 = function {pattern {bozo} / <2, 1, 1>}
>

Using v3.8.0 beta 1 in Windows, the following is interesting... or maybe
strange?

#declare F0 = function {pattern {bozo}}
...throws a fatal error just by itself, "Expected 'Rvalue to declare', pattern
found instead"

But...
#declare F0 = function {pigment {bozo}}
...works fine.

I had assumed that they were the same basic kind of entity (except for a
grayscale version when using 'pattern'.)

But more on-topic: Given a pigment instead, your 1st example does run, if a
function wrapper is included (plus an optional color_map, simply to make the
results more visually understandable). AND with only a single argument(?) pulled
out of the function, using a dot operator. For example, I can do some crazy
things with it...

pigment{
function{F0 (max(x,.5),pow(y,1.3),sqrt(z)).red}
color_map {[0,rgb 0][1,rgb <1,0,0>]}
}

Or .x for the function instead of .red


Post a reply to this message

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