-----------This is the source code of Shaaoxiong's room------------------------




#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "metals.inc"
#include "glass.inc"
#include "woods.inc"
#include "skies.inc"
#include "stones.inc"    

//SETTINGS             
global_settings {
   photons {
     count 20000
     autostop 0
     jitter .4
   }
   assumed_gamma 2.2
   number_of_waves 1
}


#declare Floor_Texture =
  texture { pigment { P_WoodGrain18A color_map { M_Wood18A }}}
  texture {
    pigment { P_WoodGrain12B color_map { M_Wood18B }}
    finish { reflection 0.25 }
  }



/*camera{                 //side view
  location <-3,2.8,-15>
  look_at <0.5,1.3,-7>
  angle 0
} */


/*camera{             // can see door
  location <0,4,-0.5>
  look_at <0,3,-3>
  angle 0
} */


/*camera{               //top view
  location <0,7,-5>
  look_at <0,2,-4>
  angle 0
} */


camera{                  //front view
  location <0,2,-14>
  look_at <0,1,-3>
  angle 0           
}  



light_source {
  <0,2.1,-14>
  color White  
  //fade_distance 50 fade_power 5
}
    
    
    


/*Dimensions*/

plane {           //floor                             
  <0,1,0>, 0
  texture {  Floor_Texture
       }
}

plane {           //ceiling                             
  <0,1,0>, 8
  texture {
    pigment { White }
    finish { phong 0.9 phong_size 6 metallic }
}

  hollow on // has an inside pigment?
}  
       
plane {                      //front wall
  <0,0,1>, -16
  texture{
    pigment { SlateBlue }
    finish { phong 0.9 phong_size 6 metallic }
    }
}      
      
plane {                      //right wall
  <1,0,0>, 4
  texture{
    pigment { White }
    finish { phong 0.9 phong_size 6 metallic }
    }
}

plane {                    //left wall
  <1,0,0>, -4
  texture{
    pigment { White }
    finish { phong 0.9 phong_size 6 metallic }
    }
}  

plane {  <0,0,1>, 0        //back wall
    texture{
    pigment { SlateBlue }
    finish { phong 0.9 phong_size 6 metallic }
    }
}



/* Picture */

merge{
  box{
     <-2.4,4,-0.048>,<-1.6,5,-0.15>
     pigment{
       image_map{jpeg "House.jpg"}
     }
  }
  box{
     <-2.5,3.9,-0.048>,<-1.5,5.1,-0.1>
     texture{T_Wood3}
  }
}






      
/* DOOR */
box {                   //door
<-3.8,0,-15.99>
<-1.8,3,-16>
texture{
pigment {
               DMFWood4
               scale 2}
    }
}

sphere{                 //door knob
<-2.1,1.5,-15.99>,0.1
}
/* End of DOOR!! */








/* Cupboard */
box {
<-0.5,0,-16>,
<3,3.5,-14>
  texture {      
      DMFWood2    // Pre-defined from stones.inc
      finish { phong 1 }
 }
}  

box {
<1.24,0,-14>,
<1.26,3.5,-14.5>
pigment{ color Black }
}

torus {              //handle
      0.2,0.05 pigment {color Black }
      rotate <0,0,0>
      translate <0.9,1.6,-14>
  }

torus {              //handle
      0.2,0.05 pigment {color Black }
      rotate <0,0,0>
      translate <1.6,1.6,-14>
  }





/* LONG LAMP  */

merge{
box {                   //stand
<-2.18,0,-5.23>,
<-2.22,0.50,-5.27>
pigment{
        }
rotate <0,10,0>
}

box {
   <-2.0,0,-5.0>,
    <-2.4,0.01,-5.5>
   pigment{
        }
rotate <0,10,0>
}    

box {
    <-2.0,0.50,-5.0>,
    <-2.4,3.0,-5.5>  
    hollow    
    texture {
      pigment {       
      color Yellow }     
      normal { bumps 0.1 scale 0.2 }
      finish { phong 1 }
    }
    rotate <0,10,0>    
    }               
     
    light_source {
    <-2.7,1,-5.25> Yellow
    fade_distance 1
    fade_power 4
    }           
   
    light_source {
    <-2.7,2,-5.25> Yellow
    fade_distance 1.1
    fade_power 4
    }           
      
    light_source {
    <-2.7,3,-5.25> Yellow
    fade_distance 1.2
    fade_power 2
    }
 translate<3.4,0,3>   
}           
/*End of long LAMP */     



 
 
 

/* LCD TV  */
merge{

#declare LCDscreen =

superellipsoid {
  <0.1,  // east-west exponent (0.0 ... 1.0)
  0.1>   // north-south exponent (0.0 ... 1.0)
  texture {           
       Soft_Silver scale 0.5        
      finish { phong 0.1 }       
    }
  scale <1.5,1.13,0.05>
  translate <0,2,-1.2>
}

#declare LCDbox =
 
  box {
    <0.1,0,0>  // one corner position <X1 Y1 Z1>
    < 2.9,  1.95,  0.1>  // other corner position <X2 Y2 Z2>
    texture { T_Glass1
              scale 1
    }    
    translate <-1.5,1,-1.45>
    }
    
#declare LCDdrawer =  

difference{
  box {
    < 0,0,0>,  // Near lower left corner
    < 3.6, 0.9, -1.3>   // Far upper right corner
    texture {  
      DMFWood2    // Pre-defined from stones.inc
      finish { phong 1 }
    }                        
    translate <-1.8,0,-1.15>
  }
 
  box {
    < 0,0,0>,  // Near lower left corner
    < 3.0, 0.7, -1.3>   // Far upper right corner
    translate <-1.5,0,-1.17>
  }    
}
 
            
union {            
   object {LCDscreen}
   object {LCDbox}
   object {LCDdrawer}
   }
 rotate -30*y
 translate<-3,0,0>
}


   
   
   

/* BED !!   */


difference{     
         
box {
    < -1.5, 0, -5.5>,  // Near lower left corner
    < -3.9, 0.6, -10>   // Far upper right corner
    texture {
      T_Wood10     // Pre-defined from stones.inc
      finish { phong 1 }
       }    
    }
    
box {
    < -1.8, 0, -5.45>,  // Near lower left corner
    < -3.6, 0.3, -10.05>   // Far upper right corner
    texture {
      T_Wood10     // Pre-defined from stones.inc
      finish { phong 1 }
       }    
    }  
    
box {
    < -1.45, 0, -5.8>,  // Near lower left corner
    < -3.95, 0.3, -9.7>   // Far upper right corner
    texture {
      T_Wood10     // Pre-defined from stones.inc
      finish { phong 1 }
       }    
    }             
}




 
/* Mattress */

// create a superquadric ellipsoid shape
// As the exponents approach 1.0, the edges get rounder
superellipsoid {
  <0.2,  // east-west exponent (0.0 ... 1.0)
  0.2>   // north-south exponent (0.0 ... 1.0)  
  texture {            
      pigment { color Red }
      normal { bumps 0.4 scale 0.5 }
      finish { phong 0.2 }   
    }
  scale <1.15,0.2,2.35>
  translate <-2.7,0.7,-7.6>
}




/*Pillow*/

// create a superquadric ellipsoid shape
// As the exponents approach 1.0, the edges get rounder
superellipsoid {
  <0.2,  // east-west exponent (0.0 ... 1.0)
  0.7>   // north-south exponent (0.0 ... 1.0)
  texture {            
      pigment { color Red }
      normal { bumps 0.4 scale 0.5 }
      finish { phong 0.1 }    
    }
  scale <0.7,0.13,0.35>
  translate <-2.7,1,-9.5>
}

/* end of BED */  


       
         
              
/* TABLE !!! */
 
  //base          
 cone {
    <3.0,0,-6.5>, 0.05    // Center and radius of one end
    <3.0,1.0,-6.5>, 0.15    // Center and radius of other end
    open              // Removes end caps
    texture { T_Stone25 scale 4 }
  }
 
  //base
  cone {
    <3.0,0,-6.5>, 0.4    // Center and radius of one end
    <3.0,0.2,-6.5>, 0.05    // Center and radius of other end
    open              // Removes end caps
    texture { T_Stone25 scale 4 }           
  }   
 
 
  //table top !
 
   box {
    <1.5,1.0,-8.5>    // Center and radius of one end
    <4.2,1.2,-4.5>      // Center and radius of other end
    texture {pigment {Blue}
    finish { phong 0.9 phong_size 6 metallic }
    }
    }
/*  End of TABLE  */      





/* Bookshelf*/
box {
    <3.2,3,-8>,    // Center and radius of one end
    <4,3.1,-5>      // Center and radius of other end
    //open              // Removes end caps
    texture {pigment {DMFWood4
               scale 2}}
}

 
 

/* Books */
box {
    <3.4,3.1,-5.7>,
    <3.9,3.9,-5.55>
    pigment{ Green }
}
box {
    <3.4,3.1,-5.85>,
    <3.9,3.9,-5.7>
    texture{
    pigment{ color Gray }
}
}
box {
    <3.4,3.1,-6>,
    <3.9,3.9,-5.85>
    pigment{ Blue }
}
box {
    <3.4,3.1,-6.15>,
    <3.9,3.9,-6>
    pigment{ Red }
}
box {
    <3.4,3.1,-6.3>,
    <3.9,3.9,-6.15>
    pigment{ Yellow }
}
box {
    <3.4,3.1,-6.45>,
    <3.9,3.9,-6.3>
    pigment{ color MandarinOrange }
}
box {
    <3.4,3.1,-6.6>,
    <3.9,3.9,-6.45>
    pigment{ color DarkOrchid }
    rotate <45,0,0>
    translate<0,-3.65,-4.61>
}
      
      
/* LAPTOP!!! */            
//screen
merge{           
  box {
    < 0.8, 0, 0 >,  // Near lower left corner
    < 1.6, 0.05, -1>   // Far upper right corner
    texture {
      T_Glass2      // Pre-defined from stones.inc
    }
    rotate <0,0,65>     // Equivalent to "rotate <0,20,0>"
    rotate <0,-30,0>
    translate <2.27,0.56,-5.4>   
  }
 
//backing for screen  
  box {
    < 0.725, 0, 0 >,  // Near lower left corner
    < 1.705, 0.05, -1.4>   // Far upper right corner
    texture {
      Silver_Metal      // Pre-defined from stones.inc
    }
    rotate <0,0,65>     // Equivalent to "rotate <0,20,0>"
    rotate <0,-30,0>
 translate <2.16,0.54,-5.2>   
  }                

merge{
//keyboard base
box {               
  <0.725,1,0>
  <1.705,1.05,-1.4>
  texture{Silver_Metal}
        //rotate <0,0,65>     // Equivalent to "rotate <0,20,0>"
        rotate <0,-30,0>
        translate <0.92,0.2,-5.92>         
}  

//keyboard
box {               
  <1.025,1,-0.15>
  <1.605,1.06,-1.25>
  pigment { Black }
        rotate <0,-30,0>
        translate <0.92,0.2,-5.92>         
     }  
}
/*  End of LAPTOP!!!  */

                      
                      
                      
/* CHAIR !!! */    

#declare ChairLegs =
      cylinder
       {
        <0,0,-0.35>, <0,0.65,-0.35>, 0.05
         open
       
       rotate <0,0,20>   
       translate <0,0,-5.5>
       }

#declare Seat =
      box {
       <0,0,0>
       <1,0.1,1>
       texture {
         pigment {
      
         color Blue }
     
         normal { bumps 0.1 scale 0.2 }
         finish { phong 1 }
         }
      }
      
#declare BackRest =
      box {
       <0,0,0>
       <0.5,0.1,1>
       texture {
         pigment {
      
         color Blue }
     
         normal { bumps 0.1 scale 0.2 }
         finish { phong 1 }
         }
       rotate <0,0,100>  
      }
 
 
  union{  object {ChairLegs translate <0,0,0.9> rotate <0,0,-25>}
          object {ChairLegs translate <0,0,0.1> rotate <0,0,-25>}
          object {ChairLegs translate <0.8,0,0.9>}
          object {ChairLegs translate <0.8,0,0.1> }
          
          //Rest
          object {ChairLegs translate <-0.02,0.6,0.9> rotate <0,0,-8>}
          object {ChairLegs translate <-0.020,0.6,0.1> rotate <0,0,-8>}
         
          object {Seat translate <-0.1,0.55,-5.85>}
          object {BackRest translate <-0.02,1.2,-5.85>}
          
          translate <0.4,0,-1.5>
          rotate <0,-6,0>
   }
}    
     
 
/* End of CHAIR !!! */    







/* Table LAMP */   
   
#declare LampStand =   
   cone {
    <3.0,1.6,-6.5>, 0.05    // Center and radius of one end
    <3.0,2.0,-6.5>, 0.05    // Center and radius of other end
    open              // Removes end caps
    texture { Polished_Chrome  scale 2 }
  }
 
#declare LampBase =
  cone {
    <3.0,1.45,-6.5>, 0.3    // Center and radius of one end
    <3.0,1.6,-6.5>, 0.05    // Center and radius of other end
    open              // Removes end caps
    texture { Polished_Chrome scale 4 }
  }
 
#declare LampStand1 =   
   cone {
    <3.0,0,-6.525>, 0.05    // Center and radius of one end
    <3.0,0.9,-6.5>, 0.05    // Center and radius of other end
    open              // Removes end caps
    texture { Polished_Chrome scale 2 }  
    rotate x*15
    }     

#declare LampHead =   
   cone {
    <3.0,0,-6.5>, 0.05    // Center and radius of one end
    <3.0,0.25,-6.5>, 0.15    // Center and radius of other end
    open              // Removes end caps
    texture { Polished_Chrome scale 4 }
    rotate x*120
    }
    
#declare LampLight =

    // An area light (creates soft shadows)
    // WARNING: This special light can significantly slow down rendering times!
light_source {
  0*x                 // light's position (translated below)
  color Yellow       // light's color
           // total number of lights in grid (4x*4z = 16 lights)
  adaptive 1          // 0,1,2,3...
  jitter              // adds random softening of light
 
  orient              // orient light
  translate <3, 2.7 , -6.2>   // <x y z> position of light
  // light_source { ...
  // put this inside a light_source to add light fading
  fade_distance 3
  fade_power 2       
 
  photons {
     refraction on
     reflection on
   }


}

   

 
union {
        object{LampBase}
        object{LampStand}
        object{LampStand1 translate <0,0.3,-0.2>}
        object{LampHead translate <0,-2.8,-9.5>}
        object{LampLight}
        
        translate <0.46,-0.25,-1>  
        }
        





/*  Big BookShelf */

difference{
  box{
    <1,0,0>,
    <4,5.6,-1.0>
    texture {
      T_Wood10
      finish {phong 0.1}  
    }
  }
  box{//Top shelf
    <1.25,4.5,-0.1>,
    <3.75,5.5,-1.1>
    texture {
      T_Wood10
      finish {phong 0.1}  
    }
  }
  box{//Second shelf
    <1.25,3.4,-0.1>,
    <3.75,4.4,-1.1>
    texture {
      T_Wood10
      finish {phong 0.1}  
    }
  }
  box{//Third shelf
    <1.25,2.3,-0.1>,
    <3.75,3.3,-1.1>
    texture {
      T_Wood10
      finish {phong 0.1}  
    }
  }
  box{//Fourth shelf
    <1.25,1.2,-0.1>,
    <3.75,2.2,-1.1>
    texture {
      T_Wood10
      finish {phong 0.1}  
    }
  }
  box{//Fifth shelf
    <1.25,0.1,-0.1>,
    <3.75,1.1,-1.1>
    texture {
      T_Wood10
      finish {phong 0.1}  
    }
  }
}



//==========================End of Bookshelf===================================

 
 
// Lotsa Books

box {
<3.6,4.5,-0.1>,
<3.75,5.3,-0.6>
pigment{ Green }
}  

box {
<1.25,3.4,-0.1>,
<1.4,4.2,-0.6>
pigment{ SlateBlue }
}  

box {
<1.4,3.4,-0.1>,
<1.55,4.2,-0.6>
pigment{ Red }
}

box {
<1.55,3.4,-0.1>,
<1.7,4.2,-0.6>
pigment{ Yellow }
}

box {
<3.6,2.3,-0.1>,
<3.75,3.1,-0.6>
pigment{ PaleGreen }
}        

box {
<3.45,2.3,-0.1>,
<3.6,3.1,-0.6>
pigment{ Black }
}   

box {
<3.3,2.3,-0.1>,
<3.45,3.1,-0.6>
pigment{ DarkOrchid }
}   

   
box {
<1.25,1.2,-0.1>,
<1.4,2,-0.6>
pigment{ Red }
}

box {
<1.4,4.5,-0.1>,
<1.55,5.3,-0.6>
pigment{ Blue }
}

box {
<1.55,4.5,-0.1>,
<1.7,5.3,-0.6>
pigment{ Yellow }
}    

box {
<1.7,4.5,-0.1>,
<1.85,5.3,-0.6>
pigment{ Green }
}    

box {
<1.85,4.5,-0.1>,
<2,5.3,-0.6>
pigment{ Orange }
}    

box {
<2,4.5,-0.1>,
<2.15,5.3,-0.6>
pigment{ SlateBlue }
}           

----------------------------------------------------THE END--------------------------------------------------------
Hosted by www.Geocities.ws

1