 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Well, I downloaded Netscape's newsreader. Microsoft's was freaking out.
Here's the code, in 3.1 format. Please notify me of any glitches in the
code.
//********************** Warning! Messy Code Ahead
**********************
camera{location<0,0,-25>look_at<0,0,0> angle 10 }
light_source{<100000,200000,-50000>,<1.2 1.2 1>}
light_source{<-100000,0,-50000>,<.2 .3 .4> shadowless}
//****************The sky:
background{rgb<.3 .5 .9>}
fog{rgb<.5 .7 1> distance 200 fog_type 2 fog_alt 5 fog_offset 0}
plane{y,100 pigment{bumps scale 170 translate z*190 turbulence 1
color_map{[0 rgb 1.5][1 rgbf<1 1 1 1>]}}normal{bumps .001}finish{diffuse
}no_shadow hollow}
plane{y,90 pigment{bumps scale 170 translate z*190 turbulence 1
color_map{[0 rgb .4][.8 rgbf<1 1 1 1>]}}normal{bumps .001}finish{diffuse
1}hollow}
//****************The Ground:
plane{y,-4 pigment{rgb 1}normal{granite 2 scale 5}hollow}
//****************The eye:
union{
//****************The white, iris and pupil:
blob{threshold 1
sphere{<0,0,0>,2,2}
sphere{<0,0,0>,.5,-.7 scale z*.7 translate z*-1}
texture{wood scale 2 texture_map{
[.16 pigment{rgb 0}] //*****************pupil
[.17 pigment{rgb<.47 .77 .47>}finish{specular .05 brilliance
.2}normal{granite .05 scale .2 sine_wave warp{black_hole<0,0,0>,.5
strength
4}}]
[.25 pigment{rgb<.5 .8 .5>}finish{specular .3 brilliance
.2}normal{granite
.05 scale<1,1,8> frequency 2 sine_wave
warp{black_hole<0,0,0>,.5 strength 4}}]
[.39 pigment{rgb<.5 .5 .4>}]
[.43 pigment{rgb .4}]
[.52 pigment{gradient z turbulence .25 translate z*.5 scale 1.5
color_map{[.3 rgb<1 .7 .7>][.5 rgb 1]}}finish{diffuse .8}]
}
}}
//******************The shiny, clear coating + lens. Also a proud
supporter
of Veins!
blob{threshold 1
sphere{<0,0,0>,2,2}
//sphere{<0,0,-1>,.5,.7}
sphere{<0,0,0>,.5,.7 scale z*.75 translate z*-.9}
texture{wood scale 2 texture_map{
[.36 pigment{rgbf<1 1 1 1>}finish{phong 1 phong_size 100 reflection .2}]
[.4 pigment{crackle ramp_wave turbulence .25 color_map{[0 rgbf<1 .9 .8
1>][.005 rgbf<1 1 1 1>]}
}finish{phong 1 phong_size 100 reflection .2}normal{granite .015 scale
.15
turbulence .5}]}}
interior{ior 1.1}
scale 1.011}
}
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
ThanksalotSamuelItrieditoutanditworksfineexceptforonemissingparameterfordiff
usekeepupthegoodworkandthanksagainforpostingyoursource!
Samuel Benge <STB### [at] aol com> wrote in message
news:376C4FA8.2641B48D@aol.com...
> Well, I downloaded Netscape's newsreader. Microsoft's was freaking out.
>
> Here's the code, in 3.1 format. Please notify me of any glitches in the
> code.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
David Cook wrote:
>
> ThanksalotSamuelItrieditoutanditworksfineexceptforonemissingparameterfordiff
> usekeepupthegoodworkandthanksagainforpostingyoursource!
David,
Pleaseuseyour"SPACE" bar : )
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Sorry Ken, I was making a wry comment about Samuel's code style. Have a boo
and I think you'll get it.
Ken <tyl### [at] pacbell net> wrote in message
news:376C605F.57AC0878@pacbell.net...
>
>
> David Cook wrote:
> >
> >
ThanksalotSamuelItrieditoutanditworksfineexceptforonemissingparameterfordiff
> > usekeepupthegoodworkandthanksagainforpostingyoursource!
>
> David,
>
> Pleaseuseyour"SPACE" bar : )
>
> --
> Ken Tyler
>
> mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
David Cook wrote:
>
> Sorry Ken, I was making a wry comment about Samuel's code style. Have a boo
> and I think you'll get it.
Actually his non indented code looks perfectly natural to me. It drives
other people nuts though especialy people with a programming background.
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Did I not warn you about the messy code? I know my code writing style probably
isn't all that great, but it is still readable by pov. By the way, if you
guessed 1 for diffuse, your'e right.
David Cook wrote:
> Sorry Ken, I was making a wry comment about Samuel's code style. Have a boo
> and I think you'll get it.
>
> Ken <tyl### [at] pacbell net> wrote in message
> news:376C605F.57AC0878@pacbell.net...
> >
> >
> > David Cook wrote:
> > >
> > >
> ThanksalotSamuelItrieditoutanditworksfineexceptforonemissingparameterfordiff
> > > usekeepupthegoodworkandthanksagainforpostingyoursource!
> >
> > David,
> >
> > Pleaseuseyour"SPACE" bar : )
> >
> > --
> > Ken Tyler
> >
> > mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> Actually his non indented code looks perfectly natural to me.
Thanks, it's good to know I'm not the only one who thinks so.
> It drives
> other people nuts though especialy people with a programming background.
I used to program in basic, but I don't think that counts.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Again, I apologize for my sarcasm. I appreciated your posting Samuel, I was
just being a wise guy. Very interesting code, after I reformatted it to my
own preferences.
And I'm anxiously awaiting the Fake/Real Caustics scene-file postings!
Samuel Benge <STB### [at] aol com> wrote in message
news:376C712F.42631FF7@aol.com...
> Did I not warn you about the messy code? I know my code writing style
probably
> isn't all that great, but it is still readable by pov. By the way, if you
> guessed 1 for diffuse, your'e right.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
yourabsolutelyrightkenimgladyouagreewithme
Ken <tyl### [at] pacbell net> wrote in message
news:376C6888.29D1A19B@pacbell.net...
>
>
> David Cook wrote:
> >
> > Sorry Ken, I was making a wry comment about Samuel's code style. Have a
boo
> > and I think you'll get it.
>
> Actually his non indented code looks perfectly natural to me. It drives
> other people nuts though especialy people with a programming background.
>
> --
> Ken Tyler
>
> mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
: Actually his non indented code looks perfectly natural to me.
Did you even try to understand how the texture was done? If yes, how many
minutes did you spend on that?
Try the same thing with a properly indented code.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
O.k. I think everyone is making their point here. I may even properly indent my
code next time I send some.....
SamuelT
STB### [at] aol com
Nieminen Mika wrote:
> Did you even try to understand how the texture was done? If yes, how many
> minutes did you spend on that?
> Try the same thing with a properly indented code.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Samuel Benge wrote:
>
> O.k. I think everyone is making their point here. I may even properly indent my
> code next time I send some.....
>
> SamuelT
Traitor !
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Well, indented or not, I've gotten this eye script with it line wrapped pretty
drastically because of the many continuous lines without spaces to break them down
when
it was being posted I'm guessing or at least because of the auto-wrapping feature
setting in Netscape was not of a length compatible to this specific pov scene file.
Nothing quite like a vector that's been split apart.
Btw, wish you more favorable postings in the future Samuel.
Samuel Benge wrote:
>
> O.k. I think everyone is making their point here. I may even properly indent my
> code next time I send some.....
>
> SamuelT
>
> STB### [at] aol com
>
> Nieminen Mika wrote:
>
> > Did you even try to understand how the texture was done? If yes, how many
> > minutes did you spend on that?
> > Try the same thing with a properly indented code.
--
omniVERSE: beyond the universe
http://members.aol.com/inversez/homepage.htm
mailto://inversez@aol.com?Subject=PoV-News
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Don't blame ya, I hate indented code, have a ultra edit macro to remove
all indent and double spaces..saves shitloads of space too.
(one wonders - I know pov ignores space/tab, but it still has to "see"
them to ignore them.... does that slow it a tiny bit?)
Ken wrote:
>
> David Cook wrote:
> >
> > Sorry Ken, I was making a wry comment about Samuel's code style. Have a boo
> > and I think you'll get it.
>
> Actually his non indented code looks perfectly natural to me. It drives
> other people nuts though especialy people with a programming background.
>
> --
> Ken Tyler
>
> mailto://tylereng@pacbell.net
--
Politicians - It seems to me that the worst of them could convince me
that horse shit tastes like honey-cake; the best of them would leave
me believing that I alone in all the world had failed
to enjoy its flavour.
The individual is more important then the state!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Morpheus Dreamlord <mor### [at] excite com> wrote:
: I hate indented code
I wonder why.
I understand if someone doesn't care if the code is indented or not, but
I really don't understand why anyone can hate it. It's like hating the way
the netscape news reader indents the articles and the responses or hating
the way the newspaper arrange their pages (when the alternative is that
everything is in one wrapping line).
I also wonder how can anyone understand the unindented code.
Since I like to show examples about this, here is one again:
#ifdef(Im) #declare a=zr*zr; #declare b=zi*zi; #declare zi=2*zr*zi+Im;
#declare zr=a-b+Re; #declare n=n+1; #if(n<9 & a+b<4) #include "obfmand.pov"
#else sphere {<Re,n/20,Im>,.05 pigment{rgb <n/9,0,0>} finish{specular .5}}
#debug substr(c,n,1) #declare Re=Re+.05; #end #else #declare c=" .,-=OXM#"
#declare Im=-1; #while(Im<=1) #declare Re=-2; #while(Re<=1) #declare zr=Re;
#declare zi=Im; #declare n=0; #include "obfmand.pov" #end #debug "\n" #declare
Im=Im+.05; #end camera { location <-3,5,-5> look_at -x*.5 angle 35 }
light_source { <100,100,0> 1 } #end
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nieminen Mika wrote:
>
> Morpheus Dreamlord <mor### [at] excite com> wrote:
> : I hate indented code
>
> I wonder why.
>
> I understand if someone doesn't care if the code is indented or not, but
> I really don't understand why anyone can hate it. It's like hating the way
> the netscape news reader indents the articles and the responses or hating
> the way the newspaper arrange their pages (when the alternative is that
> everything is in one wrapping line).
> I also wonder how can anyone understand the unindented code.
> Since I like to show examples about this, here is one again:
>
> #ifdef(Im) #declare a=zr*zr; #declare b=zi*zi; #declare zi=2*zr*zi+Im;
> #declare zr=a-b+Re; #declare n=n+1; #if(n<9 & a+b<4) #include "obfmand.pov"
> #else sphere {<Re,n/20,Im>,.05 pigment{rgb <n/9,0,0>} finish{specular .5}}
> #debug substr(c,n,1) #declare Re=Re+.05; #end #else #declare c=" .,-=OXM#"
> #declare Im=-1; #while(Im<=1) #declare Re=-2; #while(Re<=1) #declare zr=Re;
> #declare zi=Im; #declare n=0; #include "obfmand.pov" #end #debug "\n" #declare
> Im=Im+.05; #end camera { location <-3,5,-5> look_at -x*.5 angle 35 }
> light_source { <100,100,0> 1 } #end
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Your example is a bit extremist to say the least. I think what most of
the non indenting crowd argues their case for is not so much single line
parameters as much as it is the use of large spaces preceding the code for
that line. Taking the following simple example to illustrate what I am
saying:
I find this example unnaceptable and would reformat it every time:
#declare R = 0;
#while ( R < 5 )
#declare I = 0;
#while ( I < 5 )
sphere
{
< R, 0, I >,
.05
pigment
{
rgb < 1, 1, 1 >
}
finish
{
specular .5
}
}
#declare R = R + 1;
#end
#declare I = I + 1;
#end
While I find the following two perfectly acceptable:
#declare R = 0;
#while (R < 5)
#declare I = 0;
#while (I < 5)
sphere {<R,0,I>,.05 pigment{rgb<1,1,1>}finish{specular .5}}
#declare R = R + 1;
#end
#declare I = I + 1;
#end
or
#declare R = 0; #while (R < 5)
#declare I = 0; #while (I < 5)
sphere {<R,0,I>,.05 pigment{rgb<1,1,1>}finish{specular .5}}
#declare R = R + 1; #end
#declare I = I + 1; #end
While for my own scenes as the complexity has grown they most often are
now formated like this example:
#declare R = 0;
#while ( R < 5)
#declare I = 0;
#while ( I < 5)
sphere { <R,0,I>, .05
pigment { rgb <1,1,1> }
finish { specular .5 }
}
#declare R = R + 1;
#end
#declare I = I + 1;
#end
I guess it really doesn't matter since pov will read it no matter
how you do it within limits but I find my first example frustrating
to read because of the enourmous paper space it consumes. When trouble
shooting I like to see as much of my code on screen at one time as
I possibly can as opposed to scrolling up and down to view more of it.
My second two examples fit into the same space as the single first
example does and I could fit 3 of the third example into the same
space as the first.
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
: I find this example unnaceptable and would reformat it every time:
I find it unacceptable too because it's badly indented. For example the
#end statements are not indented at the same level with the #while
statements thus making it difficult to see which #end goes with which
#while. Also the { and } are badly indented. It's rather difficult to see
what block they are defining. There's also too much white space.
Indentation should be done well. With my indentation style that would
have been:
#declare R = 0;
#while (R<5)
#declare I = 0;
#while (I<5)
sphere
{ <R, 0, I>, .05
pigment { rgb <1, 1, 1> }
finish { specular .5 }
}
#declare R = R+1;
#end
#declare I = I+1;
#end
Some people like to indent with four spaces instead of two in order to
more clearly see the different blocks. That's absolutely ok. Actually I
probably will change to that style soon.
Indentation makes the code clearer assuming that you make the indentation
correctly.
: While I find the following two perfectly acceptable:
: #declare R = 0;
: #while (R < 5)
: #declare I = 0;
: #while (I < 5)
: sphere {<R,0,I>,.05 pigment{rgb<1,1,1>}finish{specular .5}}
: #declare R = R + 1;
: #end
: #declare I = I + 1;
: #end
With this indentation style it's extremely difficult to distinguish the
different blocks. This example is rather simple so that you can see the
two nested blocks, but add a couple of #if and #switch statements inside and
between the while loops and it will make it a lot more unclear.
Also you have your sphere code in just one line, which is not always
possible.
: I guess it really doesn't matter since pov will read it no matter
: how you do it within limits but I find my first example frustrating
: to read because of the enourmous paper space it consumes. When trouble
: shooting I like to see as much of my code on screen at one time as
: I possibly can as opposed to scrolling up and down to view more of it.
: My second two examples fit into the same space as the single first
: example does and I could fit 3 of the third example into the same
: space as the first.
Indentation seldom adds newlines but only spaces at the beginning of
the lines, so with properly indented code you will se exactly as much code
is with your style.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nieminen Mika wrote:
> Indentation seldom adds newlines but only spaces at the beginning of
> the lines, so with properly indented code you will se exactly as much code
> is with your style.
The biggest problem then lies with the fact that there is no agreement
as to what constitutes "proper" indentation. No one seems to be able
to agree on that either.
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
: The biggest problem then lies with the fact that there is no agreement
: as to what constitutes "proper" indentation. No one seems to be able
: to agree on that either.
A "proper" indentation is one which allows you to easyly see where does
a block start and where does it end without having to search through the
entire code (ie. you can just skip the majority of the code if you only
want to see where does the block end). This is speacially important with
nested blocks. You only need 3 or 4 levels of nesting for the non-indented
code to be almost completely unreadable.
This same indentation of nested blocks is also used in other places than
programming, for example the html lists (see for example the povVFAQ page).
The indentation of blocks makes it easy to "parse" the contents of the
text. You can easyly see the "title" of each block and choose the block
you want.
This same principle applies to code (povray or whatever). The command
at the beginning of a block is the "title" of that block (for example
"#while" or "sphere"). If you are not interested in that block you can
easyly skip it and go to the next block.
Now, this skipping is very hard if you can't see where does the block end.
It's extremely tedious to search through the entire text to see where does
the next block begin.
Just imagine a newspaper with _all_ its text without titles, blocks,
columns, newlines, empty lines, etc. Searching for certain news could be
extremely tedious. The same applies to pov-code.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Some people comment the ends of those blocks, ie.
union {
sphere {0,1}
box {-1,1}
} //union
to make certain of where things are, but that is a bit of overkill if the script has
been written out nicely enough to see what's what. Hey, here's a thought. What if
POV-Ray could see these in a parse (oops, yeah it does already) and write into your
file
this sort of thing automatically. Switchable of course for the dislikers of extra
wasted
space.
Nieminen Mika wrote:
>
> Ken <tyl### [at] pacbell net> wrote:
> : The biggest problem then lies with the fact that there is no agreement
> : as to what constitutes "proper" indentation. No one seems to be able
> : to agree on that either.
Bob here again, writes:
Remember, there's the POV-Ray code setting in the CodeMax editor. No choice there,
love
it or leave it (or further edit what it gives you, my personal favorite).
> A "proper" indentation is one which allows you to easyly see where does
> a block start and where does it end without having to search through the
> entire code (ie. you can just skip the majority of the code if you only
> want to see where does the block end). This is speacially important with
> nested blocks. You only need 3 or 4 levels of nesting for the non-indented
> code to be almost completely unreadable.
> This same indentation of nested blocks is also used in other places than
> programming, for example the html lists (see for example the povVFAQ page).
> The indentation of blocks makes it easy to "parse" the contents of the
> text. You can easyly see the "title" of each block and choose the block
> you want.
> This same principle applies to code (povray or whatever). The command
> at the beginning of a block is the "title" of that block (for example
> "#while" or "sphere"). If you are not interested in that block you can
> easyly skip it and go to the next block.
> Now, this skipping is very hard if you can't see where does the block end.
> It's extremely tedious to search through the entire text to see where does
> the next block begin.
> Just imagine a newspaper with _all_ its text without titles, blocks,
> columns, newlines, empty lines, etc. Searching for certain news could be
> extremely tedious. The same applies to pov-code.
>
--
omniVERSE: beyond the universe
http://members.aol.com/inversez/homepage.htm
mailto://inversez@aol.com?Subject=PoV-News
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nieminen Mika wrote:
> Since I like to show examples about this, here is one again:
>
> #ifdef(Im) #declare a=zr*zr; #declare b=zi*zi; #declare zi=2*zr*zi+Im;
> #declare zr=a-b+Re; #declare n=n+1; #if(n<9 & a+b<4) #include "obfmand.pov"
> #else sphere {<Re,n/20,Im>,.05 pigment{rgb <n/9,0,0>} finish{specular .5}}
> #debug substr(c,n,1) #declare Re=Re+.05; #end #else #declare c=" .,-=OXM#"
> #declare Im=-1; #while(Im<=1) #declare Re=-2; #while(Re<=1) #declare zr=Re;
> #declare zi=Im; #declare n=0; #include "obfmand.pov" #end #debug "\n" #declare
> Im=Im+.05; #end camera { location <-3,5,-5> look_at -x*.5 angle 35 }
> light_source { <100,100,0> 1 } #end
Is that how my code is read by you guys? I don't indent things, but I do keep
certain things on their own lines, if you know what I mean.
By the way, does Netscape have a signature feature so I don't have to keep writing
my name and e-mail?
SamuelT
STB### [at] aol com
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I'd like to see a atandard which includes comments on NEW lines (the are
SO easy to remove then)
Bob wrote:
>
> Some people comment the ends of those blocks, ie.
>
> union {
> sphere {0,1}
> box {-1,1}
> } //union
>
> to make certain of where things are, but that is a bit of overkill if the script has
> been written out nicely enough to see what's what. Hey, here's a thought. What if
> POV-Ray could see these in a parse (oops, yeah it does already) and write into your
file
> this sort of thing automatically. Switchable of course for the dislikers of extra
wasted
> space.
>
> Nieminen Mika wrote:
> >
> > Ken <tyl### [at] pacbell net> wrote:
> > : The biggest problem then lies with the fact that there is no agreement
> > : as to what constitutes "proper" indentation. No one seems to be able
> > : to agree on that either.
>
> Bob here again, writes:
> Remember, there's the POV-Ray code setting in the CodeMax editor. No choice there,
love
> it or leave it (or further edit what it gives you, my personal favorite).
>
> > A "proper" indentation is one which allows you to easyly see where does
> > a block start and where does it end without having to search through the
> > entire code (ie. you can just skip the majority of the code if you only
> > want to see where does the block end). This is speacially important with
> > nested blocks. You only need 3 or 4 levels of nesting for the non-indented
> > code to be almost completely unreadable.
> > This same indentation of nested blocks is also used in other places than
> > programming, for example the html lists (see for example the povVFAQ page).
> > The indentation of blocks makes it easy to "parse" the contents of the
> > text. You can easyly see the "title" of each block and choose the block
> > you want.
> > This same principle applies to code (povray or whatever). The command
> > at the beginning of a block is the "title" of that block (for example
> > "#while" or "sphere"). If you are not interested in that block you can
> > easyly skip it and go to the next block.
> > Now, this skipping is very hard if you can't see where does the block end.
> > It's extremely tedious to search through the entire text to see where does
> > the next block begin.
> > Just imagine a newspaper with _all_ its text without titles, blocks,
> > columns, newlines, empty lines, etc. Searching for certain news could be
> > extremely tedious. The same applies to pov-code.
> >
>
> --
> omniVERSE: beyond the universe
> http://members.aol.com/inversez/homepage.htm
> mailto://inversez@aol.com?Subject=PoV-News
--
Politicians - It seems to me that the worst of them could convince me
that horse shit tastes like honey-cake; the best of them would leave
me believing that I alone in all the world had failed
to enjoy its flavour.
The individual is more important then the state!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Yup, edit - prefs - mail 7 news - identity, down the bottom you add the
local address for a text sig file.
Samuel Benge wrote:
>
> Nieminen Mika wrote:
>
> > Since I like to show examples about this, here is one again:
> >
> > #ifdef(Im) #declare a=zr*zr; #declare b=zi*zi; #declare zi=2*zr*zi+Im;
> > #declare zr=a-b+Re; #declare n=n+1; #if(n<9 & a+b<4) #include "obfmand.pov"
> > #else sphere {<Re,n/20,Im>,.05 pigment{rgb <n/9,0,0>} finish{specular .5}}
> > #debug substr(c,n,1) #declare Re=Re+.05; #end #else #declare c=" .,-=OXM#"
> > #declare Im=-1; #while(Im<=1) #declare Re=-2; #while(Re<=1) #declare zr=Re;
> > #declare zi=Im; #declare n=0; #include "obfmand.pov" #end #debug "\n" #declare
> > Im=Im+.05; #end camera { location <-3,5,-5> look_at -x*.5 angle 35 }
> > light_source { <100,100,0> 1 } #end
>
> Is that how my code is read by you guys? I don't indent things, but I do keep
> certain things on their own lines, if you know what I mean.
>
> By the way, does Netscape have a signature feature so I don't have to keep writing
> my name and e-mail?
>
> SamuelT
>
> STB### [at] aol com
--
Politicians - It seems to me that the worst of them could convince me
that horse shit tastes like honey-cake; the best of them would leave
me believing that I alone in all the world had failed
to enjoy its flavour.
The individual is more important then the state!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
As long as someone that knows POV but has never seen your code before can
read it fine then your indentation is proper.
If people don't like the space it takes then why do they use comments?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I don't...
MrEdd wrote:
>
> As long as someone that knows POV but has never seen your code before can
> read it fine then your indentation is proper.
> If people don't like the space it takes then why do they use comments?
--
Politicians - It seems to me that the worst of them could convince me
that horse shit tastes like honey-cake; the best of them would leave
me believing that I alone in all the world had failed
to enjoy its flavour.
The individual is more important then the state!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken wrote:
> Nieminen Mika wrote:
>
> > Indentation seldom adds newlines but only spaces at the beginning of
> > the lines, so with properly indented code you will se exactly as much code
> > is with your style.
>
> The biggest problem then lies with the fact that there is no agreement
> as to what constitutes "proper" indentation. No one seems to be able
> to agree on that either.
For code in general, studies have found that from 2 to 6 spaces is optimal.
At least that narrows things down a _tiny_ bit.
(Personally, I usually use 4 for C/C++, Java, etc. (Often only 2 for .POV
code, but then more spaces seem to help with deeper indentation)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken wrote:
> Actually his non indented code looks perfectly natural to me. It drives
> other people nuts though especialy people with a programming background.
Ugh, I have a programming background and hence understand the importance of
INDENTATION!!!!!
I'm sorry, but do you have a programming background Ken? And you don't use
indentation in your code? And other people who look at your code are okay with
this? And you can find when the four nested for loops begin and end?
Ceeeerrazy! ;)
P.S - I just noticed, when I try to type loud, I press the keys harder. Ugh,
crazy human mind, like waving around the controller when you're playing Gran
Turismo ;)
--
That is all
*Click*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
*Sigh* wrote:
>
> Ken wrote:
> > Actually his non indented code looks perfectly natural to me. It drives
> > other people nuts though especialy people with a programming background.
>
> Ugh, I have a programming background and hence understand the importance of
> INDENTATION!!!!!
>
> I'm sorry, but do you have a programming background Ken? And you don't use
> indentation in your code? And other people who look at your code are okay with
> this? And you can find when the four nested for loops begin and end?
>
> Ceeeerrazy! ;)
It is very easy to tell when a loop ends. The Pov team implemented a
very special key word for this called #end. For every #while there must
be one #end. If you are mathmaticaly inclined enough to count up to
four #while's you should be able to count up to four #end's indented
or not. Go figure !
> P.S - I just noticed, when I try to type loud, I press the keys harder. Ugh,
> crazy human mind, like waving around the controller when you're playing Gran
> Turismo ;)
I always type loud because of my piano playing background thought it does
sound better on the keyboard.
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
: It is very easy to tell when a loop ends. The Pov team implemented a
: very special key word for this called #end. For every #while there must
: be one #end. If you are mathmaticaly inclined enough to count up to
: four #while's you should be able to count up to four #end's indented
: or not. Go figure !
So instead of just directly seeing the proper #end keyword at the first
sight, you have to be counting the number of #end statements.
Suppose something like this:
#if(something)
#while(this)
#if(some_else)
#while(that)
#if(foo)
bar
#end
#if(bar)
foo
#end
#end
#if(foo)
bar
#end
#end
#if(bar)
#while(that)
#if(foo)
bar
#end
#end
#end
#end
#end
Where does the first "#while(that)" end? How about the first #if?
For example in the case of the first #if statement you could instaneously
say where does it end with a proper indentation. Without indentation you
can't be sure before you count all the blocks.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nieminen Mika wrote:
> So instead of just directly seeing the proper #end keyword at the first
> sight, you have to be counting the number of #end statements.
> Suppose something like this:
> Where does the first "#while(that)" end? How about the first #if?
> For example in the case of the first #if statement you could instaneously
> say where does it end with a proper indentation. Without indentation you
> can't be sure before you count all the blocks.
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
This one is easy to answer. I don't know how to use the #if function in
pov so I wouldn't understand it if it was properly indented or not. This
leaves me without a basis to argue for or against your own argument.
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken <tyl### [at] pacbell net> wrote:
: This one is easy to answer. I don't know how to use the #if function in
: pov so I wouldn't understand it if it was properly indented or not. This
: leaves me without a basis to argue for or against your own argument.
#if works exactly like #while except that the #if block is parsed only
once if the condition is true. It's like a #while which doesn't loop.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
You guys really don't get it do you ? I do indent when "I" feel it
will really help in understanding the code. I generaly will only do
so however when the code I am writing is so damn confusing there is
no other way to format it. Take the following as an example where I
was forced to apply some form of indenting. There was little choice
in the matter becasue I kept loosing myself when developing it. You
may look at and think that it is not indented properly but I find it
quit understandable in it's present form.
The following is from a section of a tutorial I am writting on the gradient
pattern.
#declare P1 = pigment{rgbf< 1, 1, 1,.3>}
#declare P2 = pigment{rgbf< 0, 0, 0, 0>}
#declare P3 = pigment{rgbf< 1, 1, 1, 0>}
#declare P4 = pigment{rgbf< 0, 0, 0, 0>}
#declare N1 = normal {gradient y 0.5}
#declare N2 = normal {gradient x 1.0}
#declare Checked1 =
texture {
pigment { checker
pigment { checker
pigment { checker
pigment { checker
pigment { gradient y pigment_map{[.5 P1][.5 P2]}scale 0.5}
pigment { gradient x pigment_map{[.5 P2][.5 P1]}scale 0.5}scale 0.5}
pigment { checker
pigment { gradient y pigment_map{[.5 P1][.5 P2]}scale 0.5}
pigment { gradient x pigment_map{[.5 P2][.5 P1]}scale 0.5}scale 0.5}
scale 0.25 }
pigment { checker
pigment { checker
pigment { gradient y pigment_map{[.5 P2][.5 P1]}scale 0.5}
pigment { gradient x pigment_map{[.5 P1][.5 P2]}scale 0.5}scale 0.5}
pigment { checker
pigment { gradient y pigment_map{[.5 P2][.5 P1]}scale 0.5}
pigment { gradient x pigment_map{[.5 P1][.5 P2]}scale 0.5}scale 0.5}
scale 0.25 }
scale 1.0 }
pigment { checker
pigment { checker
pigment { checker
pigment { gradient y pigment_map{[.5 P2][.5 P1]}scale 0.5}
pigment { gradient x pigment_map{[.5 P1][.5 P2]}scale 0.5}scale 0.5}
pigment { checker
pigment { gradient y pigment_map{[.5 P2][.5 P1]}scale 0.5}
pigment { gradient x pigment_map{[.5 P1][.5 P2]}scale 0.5}scale 0.5}
scale 0.25 }
pigment { checker
pigment { checker
pigment { gradient y pigment_map{[.5 P1][.5 P2]}scale 0.5}
pigment { gradient x pigment_map{[.5 P2][.5 P1]}scale 0.5}scale 0.5}
pigment { checker
pigment { gradient y pigment_map{[.5 P1][.5 P2]}scale 0.5}
pigment { gradient x pigment_map{[.5 P2][.5 P1]}scale 0.5}scale 0.5}
scale 0.25 }
scale 1.0 }
scale 1.0 }
normal { checker
normal { checker
normal { checker
normal { checker
normal { gradient y 1 normal_map{[.5 N1][.5 N2]}scale 0.5}
normal { gradient x 1 normal_map{[.5 N2][.5 N1]}scale 0.5}scale 0.5}
normal { checker
normal { gradient y 1 normal_map{[.5 N1][.5 N2]}scale 0.5}
normal { gradient x 1 normal_map{[.5 N1][.5 N2]}scale 0.5}scale 0.5}
scale 0.25 }
normal { checker
normal { checker
normal { gradient y 1 normal_map{[.5 N1][.5 N2]}scale 0.5}
normal { gradient x 1 normal_map{[.5 N2][.5 N1]}scale 0.5}scale 0.5}
normal { checker
normal { gradient y 1 normal_map{[.5 N1][.5 N2]}scale 0.5}
normal { gradient x 1 normal_map{[.5 N2][.5 N1]}scale 0.5}scale 0.5}
scale 0.25 }
scale 1.0 }
normal { checker
normal { checker
normal { checker
normal { gradient y 1 normal_map{[.5 N2][.5 N1]}scale 0.5}
normal { gradient x 1 normal_map{[.5 N1][.5 N2]}scale 0.5}scale 0.5}
normal { checker
normal { gradient y 1 normal_map{[.5 N2][.5 N1]}scale 0.5}
normal { gradient x 1 normal_map{[.5 N1][.5 N2]}scale 0.5}scale 0.5}
scale 0.25 }
normal { checker
normal { checker
normal { gradient y 1 normal_map{[.5 N1][.5 N2]}scale 0.5}
normal { gradient x 1 normal_map{[.5 N2][.5 N1]}scale 0.5}scale 0.5}
normal { checker
normal { gradient y 1 normal_map{[.5 N1][.5 N2]}scale 0.5}
normal { gradient x 1 normal_map{[.5 N2][.5 N1]}scale 0.5}scale 0.5}
scale 0.25 }
scale 1.0 }
bump_size 1 }
finish { ambient 0.3 diffuse 0.4 }
rotate 45*z
scale 1
}
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Ken heeft geschreven in bericht <3774DBE1.5142A098@pacbell.net>...
>
>
> You guys really don't get it do you ? ....
> The following is from a section of a tutorial I am writting on the gradient
>pattern.
>
> #declare P1 = pigment{rgbf< 1, 1, 1,.3>}
> #declare P2 = pigment{rgbf< 0, 0, 0, 0>}
> #declare P3 = pigment{rgbf< 1, 1, 1, 0>}
> #declare P4 = pigment{rgbf< 0, 0, 0, 0>}
>
> #declare N1 = normal {gradient y 0.5}
> #declare N2 = normal {gradient x 1.0}
>
> #declare Checked1 =
> texture {
> pigment { checker
> pigment { checker
> .... and it goes on and on and on
WHAT is this?
I have a big 23" monitor, that I'm intersesed in buying, here this weekend for
some testing.
Renderd this texture.
Now I don't want the monitor anymore. It' toooo small !!!!!!!
ingo
--
Met dank aan de muze met het glazen oog.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Can you post a URL to an image using this interesting-looking texture?
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Nieminen Mika wrote:
>
> Can you post a URL to an image using this interesting-looking texture?
>
> --
> main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
> ):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
On 04-16-1999 in the images group in the thread titled
"Since we are doing trees" I posted an example using this
or a very similar version of this pattern. If you can't
find it I will repost is you desire.
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
To get the full appreciation, map the texture onto a sphere, put the camera
inside, and create an animation of the camera rotating. It's enough to make
one either queasy or hypnotized.
-Alex V.
Note to self: Bile belongs in the liver and gall bladder. Bile belongs in the
liver and gall bladder. Bile belongs in the liver and gall bladder..
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
You guys are still arguing over indentation?!?!?!? Truly this must have been
building before I ever posted the eyeball code!
Well, I am slowly deciding it may be a good thing to indent my code when I post
here. I like to stuff many things onto one line, because it saves me vertical
space. But for your sakes, I will try to indent my code.
Post a reply to this message
Attachments:
Download 'us-ascii' (1 KB)
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
ingo wrote:
> > .... and it goes on and on and on
>
> WHAT is this?
> I have a big 23" monitor, that I'm intersesed in buying, here this weekend for
> some testing.
> Renderd this texture.
> Now I don't want the monitor anymore. It' toooo small !!!!!!!
>
> ingo
> --
> Met dank aan de muze met het glazen oog.
I have a simple solution. Add this to your scene file:
#declare Monitor_Scale = 2
object { Monitor scale Monitor_Scale }
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
I don't see the problem.
Ken (or whoever) writes and posts code anyway he wants to, people decide to
either spend time trying to figure it out or spend time complaining, Ken
either lets it bother him or not... everyone does exactly what they want to
do...
Anarchy... Love it or hate it, just be sure to obey it, it's the law.
SamuelT. <STB### [at] aol com> wrote in message
news:3775712B.440D5503@aol.com...
> You guys are still arguing over indentation?!?!?!? Truly this must have
been
> building before I ever posted the eyeball code!
> Well, I am slowly deciding it may be a good thing to indent my code when I
post
> here. I like to stuff many things onto one line, because it saves me
vertical
> space. But for your sakes, I will try to indent my code.
>
>
>
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"SamuelT." wrote:
>
> You guys are still arguing over indentation?!?!?!? Truly this must have been
> building before I ever posted the eyeball code!
> Well, I am slowly deciding it may be a good thing to indent my code when I post
> here. I like to stuff many things onto one line, because it saves me vertical
> space. But for your sakes, I will try to indent my code.
All right! A challenge! Write a "Pritty-Printing" program that will
input the "offending"
POV scene code and output a file formatted in your favorite format. ei :
no tabs or
tabs only or "asmuchasyoucanstuffononeline" or
one
key
word
per
line
.
I have seen this done for Pascal and I have the text on my bookshelf
somewhere.
I intend to find it and adapt. Maybe set alternate format schemes. If
someone could then just
agree on a "posting format". Just think, no more need to comment on
format, each could
get the text and convert to his or her favorite format.
All I have to program in is qbasic that came with ms-dos. So please feel
free to pick-up this
challenge and write your own in whatever language you can.
Also, think about a "posting format", one that will generate the least
amount of negative
comments. Lets give the NG a "unified, professional" appearance. Lets
stop the bickering.
Mr. Art
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |