POV-Ray : Newsgroups : povray.advanced-users : dot-notation not allowed in functions? : Re: dot-notation not allowed in functions? Server Time
27 Apr 2024 23:41:06 EDT (-0400)
  Re: dot-notation not allowed in functions?  
From: Tor Olav Kristensen
Date: 30 Jul 2018 13:00:01
Message: <web.5b5f4319497a6101703f3ee90@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 30.07.2018 um 14:53 schrieb Kenneth:
>
> > I assumed that the dot-notation would work-- because the components of VAR are
> > all individual scalar quantities now.
> >
> > I tried surrounding the individual VAR components with parentheses (to try and
> > 'eliminate' their vector nature, similar to dot-operator use for colors when a
> > 'non-color' value is needed) but that doesn't work either.
> >
> > I'm curious to know the reason for this limitation.
>
> Functions are essentially processed by a completely different parser.
> Some features implemented in the normal parser never made it into the
> functions parser.

IIRC one can use dot notation in functions when dealing with vector valued
functions. Here's an example that works:

#include "functions.inc"
#declare T_Fn =
    function {
        transform {
            scale <3, 1, 2>
            inverse
        }
    }
#declare Ellipsoid_Fn =
    function {
        f_sphere(
            T_Fn(x, y, z).x,
            T_Fn(x, y, z).y,
            T_Fn(x, y, z).z,
            1
        )
    }

--
Tor Olav
http://subcube.com


Post a reply to this message

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