Advertisement
FoxyCorndog

castle

Mar 26th, 2012
560
0
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 = 4;
  4.  
  5. #declare random = seed(1000);
  6.  
  7. camera
  8. {
  9.     location <50, 50, -10 * 3>
  10.     look_at <0, 0, 0>
  11. }
  12.  
  13. light_source
  14. {
  15.     <50, 50, -10 * 3>
  16.     color rgb <1, 1, 1>
  17. }
  18.  
  19. #macro fun(varWidth, varHeight)
  20.     #declare vx = 0;
  21.     #declare vy = 0;
  22.    
  23.     #while (vx < varWidth)
  24.         #while (vy < varHeight)
  25.             #declare colorOff = 1 - rand(random) / 5;
  26.            
  27.             box
  28.             {
  29.                 <vx * brickWidth, vy * brickHeight, 0>
  30.                 <vx * brickWidth + brickWidth, vy * brickHeight + brickHeight, brickLength>
  31.                
  32.                 pigment
  33.                 {
  34.                     color rgb <colorOff, colorOff, colorOff>
  35.                 }
  36.             }
  37.            
  38.             #declare vy = vy + 1;
  39.         #end
  40.        
  41.         #declare vx = vx + 1;
  42.         #declare vy = 0;
  43.     #end
  44. #end
  45.  
  46. fun(10, 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement