POV-Ray : Newsgroups : povray.general : Fuctions, My two cents : Re: Fuctions, My two cents Server Time
3 May 2024 05:01:46 EDT (-0400)
  Re: Fuctions, My two cents  
From: Bald Eagle
Date: 27 Feb 2023 06:30:00
Message: <web.63fc9378f28769a31f9dae3025979125@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> "Kenneth" <kdw### [at] gmailcom> wrote:
>
> >
> > My understanding (from the docs) is that a function takes only a 'slice' of a
> > pattern in the x/y plane, by definition...
>
> ....for use in a height_field, that is! Sorry if I didn't make that clear.

 #declare PigM=function{pigment{image_map{ tga "FinalB.tga"}}}

 #declare Dirt =
function(x,z){select(PigM(x,1-z,0).blue,0,0,PigM(x,1-z,0).blue)}

 height_field {function 400,400{ Dirt(x,y) }...


I think maybe what's going on there is much like passing values into a macro
using macro arguments.

he's passing (x, y) into Dirt () when he invokes it through the hf declaration.
and so Dirt sees 2 values, and assigns them to (x, z) in its definition.

Confusing, and needs checking to verify, but that's my take at 6:30am.  ;)

- BW


Post a reply to this message

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