POV-Ray : Newsgroups : povray.general : Math Stuff Help Needed - Please : Re: Math Stuff Help Needed - Please Server Time
12 Aug 2024 11:24:06 EDT (-0400)
  Re: Math Stuff Help Needed - Please  
From: Stephen Lavedas
Date: 14 Feb 1999 23:18:30
Message: <36C7A026.352D21@virginia.edu>
To quote Kryten from Red Dwarf "OH MY GOD!! It's HIDEOUS!!!"  No wonder
you can't do your work... of course you realize that there are no
appreciable HD savings in this version since the minimum sector size is
4k and so any file less than 4K in size takes up 4K anyhow... In larger
scenes, there will be some, but really, the ease of reading is SOO much
improved with indentation that I don't doubt you have problems getting
lost in your code...Take a look at my indented version. (comments
removed to kill wrap errors)

#declare HalfDome_1 = 
union {
#declare aa = 0;
   #while  (aa < 90)
      #declare bb = 0;
      #while  (bb < 45)
         box{
             -.5,.5
             scale     <.05, 1.50, 1.50>         
             translate <-40, 0.00,    0>        
             rotate    <0.0, 0.00,-2*bb>         
             scale     <1.0, 1.00,1.45+pi/90*(-bb)> 
             rotate    <0.0, 2*aa, 0.00>         
             translate <0.0, 0.75, 0.00>         
            }       
         #declare bb = bb+1;
      #end
      #declare aa = aa+1;
   #end 
 }
Sure it takes more lines, but I can easily see where loops begin and
end, and which block my commands belong to (you'll rarely see a missing
} in my code) adding new lines is easy and removing things without
causing problems is easy as well because I can see what I am affecting. 

Steve
Ever on the crusade for indentation.

Ken wrote:
> 
> Stephen Lavedas wrote:
> >
> > Ahh...okay, so the size of the box determines all else..I will work on
> > this.. oh, and did you ever think that perhaps the reason you are
> > getting lost is because you don't indent and therefore have to spend all
> > of your time thinking about where you are in the program?
> >
> > Steve
> 
> I once gave serious consideration to indenting my scene files and
> it lasted for at least 5 minutes. I then dismissed it as a complete
> waste of time and resources. Below you will see how my scene files
> are usualy written. The source I posted to night was layed out straight
> for the bennefit of those who just can't stand it any other way. A full
> screen of pov script reduced to 3 lines. Neat isn't it ?
> 
>  #declare HalfDome_1=union{#declare aa=0;#while(aa<90)#declare bb=0;#while(bb<45)
>  box{-.5,.5 scale<.05,1.5,1.5>translate z*-40 rotate z*-2*bb
scale<1,1,1.6+pi/90*-bb>
>  rotate y*2*aa translate y*.75}#declare bb=bb+1;#end#declare aa=aa+1;#end}
> 
> --
> Ken Tyler
> 
> mailto://tylereng@pacbell.net


Post a reply to this message

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