POV-Ray : Newsgroups : povray.newusers : Two meanings of x? : Re: Two meanings of x? Server Time
30 Jul 2024 22:22:27 EDT (-0400)
  Re: Two meanings of x?  
From: Dave Matthews
Date: 6 Aug 2003 09:55:00
Message: <web.3f3107c128b286237196f5900@news.povray.org>
Warp wrote:
>Dave Matthews <mat### [at] dinecollegeedu> wrote:
>> Your diagnosis "you seem to expect the #if() statement to execute when the
>> function is run" was absolutely true, and the basis for most of my
>> confusion.
>
>  All #-commands are interpreted when the function is parsed. An 'x' inside
>a #-command (such as #if) is the "parse-time x", that is the vector <1,0,0>.
>  After the function has been parsed (and byte-compiled to internal format),
>no #-commands are seen anymore. Only what was left after the #-commands
>were parsed are seen.
>  #if is a parsing-time command. select() is a function which is evaluated
>at runtime (meaning when the function is called at parse or render time).
>
>  I know, it's a bit difficult to understand and explain...
>
>plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
>sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
>density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
><1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -
>

Thanks.  That's about what I had figured out after Christopher's
explanation, but this completely clarifies it.  That also explains what
I've been reading about people attempting to create fractal functions using
'select()' --  I couldn't figure out what would be so tough about it just
using #while.... Now I'm beginning to understand (I think.)

And now I can even start using functions and isosurfaces.

Opens up a whole new world;-)


Post a reply to this message

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