POV-Ray : Newsgroups : povray.binaries.images : City SSC WIP 2 : Re: City SSC WIP 2 Server Time
11 Aug 2024 23:15:30 EDT (-0400)
  Re: City SSC WIP 2  
From: Tek
Date: 18 Feb 2004 13:11:49
Message: <4033aae5$1@news.povray.org>
I don't believe so, I think pov's # instructions aren't exactly a strict
pre-processor, though I might be completely wrong!

Though it's pretty easy to expand by hand, this is the more readable version I'm
going to submit with my entry:

#local A=function{pigment{crackle solid}}
#local B=function{pigment{crackle}}

#local Scale = 1/9;    //scale the isosurface to fit inside the unit sphere (the
default container object).
#local MaxGradient = 99;

isosurface{
    function{
        max(
            2+y/Scale-A(x/Scale,0,z/Scale).x*4,    //solid crackle pigment + y
=> horizontal roofs of buildings
            .2-B(x/Scale,0,z/Scale).x    //crackle pigment => walls of
buildings. .2 is the gap between buildings.
        )/MaxGradient   //adjust range of values to fit default max_gradient ==
1
    }
    finish{reflection{0,1}}
}

fog{
    rgb <1,1.2,1.33>
    distance .7
    fog_type 2
    fog_alt.1
}

sky_sphere{pigment{agate}}

sphere{<5.4,-3.6,5.4>, 5}

-- 
Tek
www.evilsuperbrain.com


"stephen parkinson" <ste### [at] zmemw16demoncouk> wrote in message
news:4033a4fc@news.povray.org...
> Dave Matthews wrote:
> >
> >> All { braces must have a matching } brace. This scene just puts the
> >> opening braces in the macro, and the closing braces after the calls to
> >> that macro. Cleanly indented, the code's a lot easier to understand:
> >>
> >> #macro C()
> >>     function {
> >>         pigment {crackle
> >> #end
> >>
> >> #local A = C() solid}}
> >>
> >> #local B = C() }}
> >>
> >> This is equivalent to:
> >>
> >> #local A = function {pigment {crackle solid}}
> >>
> >> #local B = function {pigment {crackle}}
> >>
> > OH.  Clever.  I guess that if I traced it out the whole code, I should
> > have seen that.
> >
> > Thanks
> >
> > Dave Matthews
> >
>
> is there a way of capturing the expanded source ?
>
> similar to gcc -S||-s ??
>
> stephen


Post a reply to this message

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