![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <4032345b$1@news.povray.org>,
Dave Matthews <dma### [at] nospam net> wrote:
> Hmm. How do you know that, for example, some end "}" are unnecessary?
> (I assume that, as usual, I'm missing something in the manual.)
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}}
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Sun, 15 Feb 2004 19:06:02 -0800, "Tek" <tek### [at] evilsuperbrain com>
wrote:
>
>This is probably the final version. What do you think of it?
>
>Oh, and just because I can, here's the full source:
That is really cool. Could you also post the source for the
first version please?
thank you
Pete
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"nospam" <Pet### [at] nym alias net almost> wrote in message
news:4032d448.12822716@localhost...
> That is really cool. Could you also post the source for the
> first version please?
Certainly:
#macro C()function{pigment{crackle#end#local A=C()solid}}#local
B=C()}}isosurface{function{max(2+y*9-A(x*9,0,z*9).x*4,.2-B(x*9,0
,z*9).x)/80}pigment{rgb z+y}finish{reflection{.8 metallic.1}
ambient 0}}sky_sphere{pigment{agate scale 2}}
Enjoy :)
--
Tek
www.evilsuperbrain.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> 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
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
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] zmemw16 demon co uk> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <4033a4fc@news.povray.org>,
stephen parkinson <ste### [at] zmemw16 demon co uk> wrote:
> is there a way of capturing the expanded source ?
>
> similar to gcc -S||-s ??
Nope. Macro expansions are done as the scene is parsed, not as a
preprocessing step.
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Tue, 17 Feb 2004 22:43:29 -0800, "Tek" <tek### [at] evilsuperbrain com>
wrote:
>> That is really cool. Could you also post the source for the
>> first version please?
>
>Certainly:
>
Thank you!
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Tek" <tek### [at] evilsuperbrain com> wrote in
news:403033c1@news.povray.org:
> After thee feedback from my last posting, I've decided to
> enter the city image in the short code contest. I've
> managed to find enough room in the 256 bytes of source to
> add some fog and a hill in the distance, and to completely
> change the colours, I'm really pleased with the result :)
>
> This is probably the final version. What do you think of
> it?
Just 3 words: Evil, Super, Brain
P.S. 1 more word: Outstanding!
> Oh, and just because I can, here's the full source:
> #macro C()function{pigment{crackle#end#local
> A=C()solid}}#local
> B=C()}}isosurface{function{max(2+y*9-A(x*9,0,z*9).x*4,.2-B(x
> *9,0 ,z*9).x)/99}finish{reflection{0,1}}}fog{rgb
> 1+y/5+z/3distance.7 fog_type
> 2fog_alt.1}sky_sphere{pigment{agate}}sphere{9*(.6-y),5}
--
Marc Champagne
marcch.AT.videoSPAMNOTtron.DOT.ca.invalid
Montreal, Canada
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Marc Champagne" <marcch.AT.videoSPAMNOTtron.DOT.ca.invalid> wrote in message
news:Xns9499E8B0E6227POVMIKA@203.29.75.35...
> Just 3 words: Evil, Super, Brain
>
> P.S. 1 more word: Outstanding!
:D
Thanks!
--
Tek
www.evilsuperbrain.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |