POV-Ray : Newsgroups : povray.binaries.scene-files : PoVEarth: strange phenomenon Server Time
15 Jun 2024 12:47:28 EDT (-0400)
  PoVEarth: strange phenomenon (Message 1 to 1 of 1)  
From: Jörg 'Yadgar' Bleimann
Subject: PoVEarth: strange phenomenon
Date: 31 Jul 2008 07:30:25
Message: <4891a251@news.povray.org>
High!

After the harddisk crash, I found out, that I made the last backup 
BEFORE I started the PoVEarth project... so I had to program the (still 
very embryonic) scene once again. After advancing to the balconies (but 
not yet to the floor cutouts and balcony doors), I noticed that suddenly 
the blue sky_sphere (lines 153 to 165) disappeared, although the scale 
flag models[3] was set... and when I commented out the mentioned lines, 
also the ground plane (lines 169 to 177) disappeared, even after I added 
a new (also conditional) definition of the sky_sphere (lines 190 to 
202)! Why? All #if clauses are properly terminated by #end...

Here's the code:

// My Place in the World
// A sub-sub-subsection of the PoVEarth project

// E-mail: yaz### [at] gmxde

// RADIOSITY

#declare radio=1;

global_settings
{
   #if (!radio)
     ambient_light 0.15
   #else
     ambient_light 0
     radiosity
     {
       brightness 1
       adc_bailout 0.01
       gray_threshold 0.8
     }
   #end
}

// TIME VARIABLES

// PIGMENTS

#declare P_Concrete =
pigment
{
   color rgb 0.9
}

// FINISHES

#declare F_Standard =
finish
{
   diffuse 1
   brilliance 0.15
}

// NORMALS

// TEXTURES

#declare T_Concrete =
texture
{
   pigment { P_Concrete }
   finish { F_Standard }
}

// LENGTH VARIABLES

#declare FrKarl_SideStreet_Width = 6.09;
#declare FrKarl_SideStreet_Pavement_Width = 1.32;
#declare GWG_FrKarl_Block_Front_Way_Length = 4.09;
#declare GWG_FrKarl_Block_Front_Doorstep_Depth = 0.427;
#declare GWG_FrKarl_Block_Stair_Height = 0.168;
#declare GWG_FrKarl_Block_Floor_Height = 16 * GWG_FrKarl_Block_Stair_Height;
#declare GWG_FrKarl_Block_Floor_yOffset = 8 * GWG_FrKarl_Block_Stair_Height;
#declare GWG_FrKarl_Block_Ceiling_Thickness = 0.148;
#declare GWG_FrKarl_Block_Balcony_Spacing=9.19;

#declare GWG_FrKarl_Block_Floor_Offset =
// OBJECT DEFINITIONS

#declare GWG_FrKarl_Block_Raw=
box
{
   0, <11.08, 9.523, 53.49>
}

#declare GWG_FrKarl_Block_Balcony_Raw=
difference
{
   box
   {
     0, <1.155, 0.948, 3.24>
   }
   box
   {
     <0.165, 0.148, 0.155>, <1.65, 0.95, 3.085>
   }
}



// CAMERA SETTINGS
// using microlocal coordinates

#declare view=1;

#switch(view)
   #case (0)
     #declare camPos = <-5, 1.7, -10>;
     #declare camLook = <5, 7.2, 3>;
     #declare camAng = 40;
   #break
   #case (1)
     #declare camPos = <-(FrKarl_SideStreet_Width / 2 + 
FrKarl_SideStreet_Pavement_Width + GWG_FrKarl_Block_Front_Way_Length +
                        GWG_FrKarl_Block_Front_Doorstep_Depth), 1.7, 70>;
     #declare camLook =<-(FrKarl_SideStreet_Width / 2 + 
FrKarl_SideStreet_Pavement_Width + GWG_FrKarl_Block_Front_Way_Length +
                        GWG_FrKarl_Block_Front_Doorstep_Depth), 1.7, 0>;
     #declare camAng = 60;
   #break
#end

// ACTUAL SCENE

#declare detail=0;

#if (!detail) // full scene views

   // SCALE MODELS

   #declare models = array[5] { 0, 0, 0, 1, 0 }
   // models[0]: cosmic scale - whole Solar System, heliocentric
   // models[1]: global scale - Earth, geocentric, spherical terrain relief
   // models[2]: regional scale - 40 x 40 kms area around Cologne, 
heightfield
   // models[3]: local scale - 500 x 500 metres around my apartment, plane
   // models[4]: microlocal - my apartment only, outside world only as 
HDRI bitmaps

   #declare a=0;
   #declare i=0;
   #while (a<5)
     #if (models[a])
       #declare i=i+1;
     #end
     #declare a=a+1;
   #end

   #if (!i | i>1)
     #warning "Missing or ambiguous scale setting" // terminating POV script
   #else
     #if (models[0])
       #declare f=1000000 // 1 unit = 1000 kms
     #end
     #if (models[1])
       #declare f=1000; // 1 unit = 1 km
     #end
     #if (models[2] | models[3] | models[4])
       #declare f=1; // 1 unit = 1 metre
     #end

     #if (models[3])
       #declare trans=<251.565, 0, 250.325>;
     #end

     /* #if (models[3])
       sky_sphere
       {
         pigment
         {
           gradient y
           color_map
           {
             [0 rgb <0.7, 1, 1>]
             [0.15 rgb <0, 0.4, 1>]
             [1    rgb <0, 0.4, 1>]
           }
         }
       }
     #end */

     #if (models[3] | models[4])
       plane
       {
         y, 0
         texture // bare sandy soil
         {
           pigment { color rgb <0.5, 0.35, 0.2> }
           finish { F_Standard }
         }
       }
     #end

     #if (models[2] | models[3])
       light_source
       {
         <0, 500000, 1000000>
         color rgb 1
       }
     #end


     #if (models[3])
     sky_sphere
     {
       pigment
       {
         gradient y
         color_map
         {
           [0 rgb <0.7, 1, 1>]
           [0.25 rgb <0, 0.5, 1>]
           [1    rgb <0, 0.5, 1>]
         }
       }
     }
     #end

     union
     {

and #252
       {
         GWG_FrKarl_Block_Raw
         scale 1/f
         translate trans/f
       }
       #declare a=0;
       #while (a<3) // 3 floors with balconies
         #declare b=0;
         #while (b<2) // 2 balconies per floor
           object
           {
             GWG_FrKarl_Block_Balcony_Raw
             translate (<-1.155 +b * 0.515, 
GWG_FrKarl_Block_Floor_yOffset + a * GWG_FrKarl_Block_Floor_Height, 
1.045 + b * GWG_FrKarl_Block_Balcony_Spacing>
                        + trans)/f
           }
           #declare b = b + 1;
         #end
         #declare a = a + 1;
       #end
       texture { T_Concrete }
     }


and #244
     {
       GWG_FrKarl_Block_Raw
       texture { T_Concrete }
       scale 1/f
       translate (< -((FrKarl_SideStreet_Pavement_Width + 
GWG_FrKarl_Block_Front_Way_Length + 
GWG_FrKarl_Block_Front_Doorstep_Depth) * 2 +
                      FrKarl_SideStreet_Width)*2,
                      0,
                      0 > + trans)/f
     }
				
     camera
     {
       location camPos/f+trans
       look_at camLook/f+trans
       angle camAng
     }


   #end

#else // single detail views

   sky_sphere
   {
     pigment { color rgb 1 }
   }

   plane
   {
     y, 0
     texture
     {
       pigment { color rgb 1 }
       finish { F_Standard }
     }
   }

   light_source
   {
     <1000, 2000, -4000>
     color rgb 1
   }

   object
   {
     GWG_FrKarl_Block_Balcony_Raw
     texture { T_Concrete }
   }

   camera
   {
      location <8, 1.5, 1.6>
      look_at  <0, 0.5, 1.6>
      angle 40
   }

#end


Post a reply to this message

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