FoxyCorndog

castlee

Mar 28th, 2012
405
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #declare brickWidth      = 10;
  2. #declare brickHeight     = 3.5;
  3. #declare brickLength     = 5;
  4.  
  5. #declare random          = seed(1000);
  6.  
  7. #declare leftRight       = 0;
  8. #declare forwardBackward = 1;
  9.  
  10. #declare zoom = 30;
  11.  
  12. camera
  13. {
  14.     location <75 + zoom, 50 * 3 + zoom, -250 - zoom>
  15.     look_at <0, 0, 0>
  16. }
  17.  
  18. light_source
  19. {
  20.     <0, 50 * 3, -10 * 7 * 3>
  21.     color rgb <1, 1, 1>
  22. }
  23.  
  24. box
  25. {
  26.     <-3 * brickWidth, 0, 10>
  27.     <3 * brickWidth, 100, 0>
  28.    
  29.     pigment
  30.     {
  31.         color rgb <1, 1, 0>
  32.     }
  33. }
  34.  
  35. box
  36. {
  37.     <-1, 0, 10>
  38.     <1, 100, 0>
  39.    
  40.     pigment
  41.     {
  42.         color rgb <1, 0, 0>
  43.     }
  44. }
  45.  
  46. #macro buildWall(varWidth, varHeight, varLength, varX, varY, varZ, varDirection, varMirror)
  47.     #declare vx = 0;
  48.     #declare vy = 0;
  49.    
  50.     #declare varX = varX * brickWidth;
  51.     #declare varY = varY * brickHeight;
  52.     #declare varZ = varZ * brickLength;
  53.    
  54.     #if (varDirection = leftRight)
  55.         #declare vw = varWidth;
  56.         #declare vh = varHeight;
  57.     #end
  58.     #if (varDirection = forwardBackward)
  59.         #declare vw = varLength;
  60.         #declare vh = varHeight;
  61.     #end
  62.    
  63.     #while (vx < vw)
  64.         #while (vy < vh)
  65.             #declare colorOff = 1 - rand(random) / 5;
  66.            
  67.             box
  68.             {
  69.                 #if (varDirection = leftRight)
  70.                     <vx * brickWidth + varX, vy * brickHeight + varY, varZ>
  71.                     <vx * brickWidth + brickWidth + varX, vy * brickHeight + brickHeight + varY, brickLength + varZ>
  72.                 #end
  73.                
  74.                 #if (varDirection = forwardBackward)
  75.         //          <varX, vy * brickHeight + varY, brickWidth + varZ * vx>
  76.         //          <brickLength + varX, vy * brickHeight + brickHeight + varY, brickWidth + brickWidth + varZ * vx>
  77.        
  78.                     <varX, vy * brickHeight + varY, vx * brickWidth + varZ>
  79.                     <brickLength + varX, vy * brickHeight + brickHeight + varY, vx * brickWidth + brickWidth + varZ>
  80.                 #end
  81.                
  82.                 pigment
  83.                 {
  84.                     color rgb <colorOff, colorOff, colorOff>
  85.                 }
  86.             }
  87.            
  88.             #declare vy = vy + 1;
  89.         #end
  90.        
  91.         #declare vx = vx + 1;
  92.         #declare vy = 0;
  93.     #end
  94.    
  95.     #if (varMirror)
  96.         #if (varDirection = forwardBackward)
  97.             #declare w = varWidth / 2;
  98.         #else
  99.             #declare w = varWidth;
  100.         #end
  101.    
  102.         #declare varX = (-varX / brickWidth) - (w);
  103.         #declare varY = ( varY / brickHeight);
  104.         #declare varZ = ( varZ / brickLength);
  105.    
  106.         buildWall(varWidth, varHeight, varLength, varX, varY, varZ, varDirection, false)
  107.     #end
  108. #end
  109.  
  110.  
  111. //buildWall(8, 10, 1 , -12  , 0, 0   , leftRight      , true)
  112. buildWall(8, 10, 1 , 3    , 0, 0   , leftRight      , true)
  113. //buildWall(6, 10, 1 , -18  , 0, -4  , leftRight      , true)
  114. buildWall(6, 10, 1 , 11   , 0, -4  , leftRight      , true)
  115. //buildWall(1, 10, 6 , -18  , 0, -4  , forwardBackward, true)
  116. //buildWall(1, 10, 1 , -17.5, 0, 7   , leftRight      , true)
  117. //buildWall(1, 10, 13, -17  , 0, 8   , forwardBackward, true)
  118. //buildWall(1, 10, 2 , -12  , 0, -4  , forwardBackward, true)
  119. buildWall(1, 10, 2 , 11  , 0, -3 , forwardBackward, true)
  120. buildWall(1, 10, 6 , 16.5  , 0, -3 , forwardBackward, true)
  121. buildWall(6, 10, 1 , 11   , 0, 2  , leftRight      , true)
RAW Paste Data