Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #declare brickWidth = 10;
- #declare brickHeight = 3.5;
- #declare brickLength = 5;
- #declare random = seed(1000);
- #declare leftRight = 0;
- #declare forwardBackward = 1;
- #declare zoom = 30;
- camera
- {
- location <75 + zoom, 50 * 3 + zoom, -250 - zoom>
- look_at <0, 0, 0>
- }
- light_source
- {
- <0, 50 * 3, -10 * 7 * 3>
- color rgb <1, 1, 1>
- }
- box
- {
- <-3 * brickWidth, 0, 10>
- <3 * brickWidth, 100, 0>
- pigment
- {
- color rgb <1, 1, 0>
- }
- }
- box
- {
- <-1, 0, 10>
- <1, 100, 0>
- pigment
- {
- color rgb <1, 0, 0>
- }
- }
- #macro buildWall(varWidth, varHeight, varLength, varX, varY, varZ, varDirection, varMirror)
- #declare vx = 0;
- #declare vy = 0;
- #declare varX = varX * brickWidth;
- #declare varY = varY * brickHeight;
- #declare varZ = varZ * brickLength;
- #if (varDirection = leftRight)
- #declare vw = varWidth;
- #declare vh = varHeight;
- #end
- #if (varDirection = forwardBackward)
- #declare vw = varLength;
- #declare vh = varHeight;
- #end
- #while (vx < vw)
- #while (vy < vh)
- #declare colorOff = 1 - rand(random) / 5;
- box
- {
- #if (varDirection = leftRight)
- <vx * brickWidth + varX, vy * brickHeight + varY, varZ>
- <vx * brickWidth + brickWidth + varX, vy * brickHeight + brickHeight + varY, brickLength + varZ>
- #end
- #if (varDirection = forwardBackward)
- // <varX, vy * brickHeight + varY, brickWidth + varZ * vx>
- // <brickLength + varX, vy * brickHeight + brickHeight + varY, brickWidth + brickWidth + varZ * vx>
- <varX, vy * brickHeight + varY, vx * brickWidth + varZ>
- <brickLength + varX, vy * brickHeight + brickHeight + varY, vx * brickWidth + brickWidth + varZ>
- #end
- pigment
- {
- color rgb <colorOff, colorOff, colorOff>
- }
- }
- #declare vy = vy + 1;
- #end
- #declare vx = vx + 1;
- #declare vy = 0;
- #end
- #if (varMirror)
- #if (varDirection = forwardBackward)
- #declare w = varWidth / 2;
- #else
- #declare w = varWidth;
- #end
- #declare varX = (-varX / brickWidth) - (w);
- #declare varY = ( varY / brickHeight);
- #declare varZ = ( varZ / brickLength);
- buildWall(varWidth, varHeight, varLength, varX, varY, varZ, varDirection, false)
- #end
- #end
- //buildWall(8, 10, 1 , -12 , 0, 0 , leftRight , true)
- buildWall(8, 10, 1 , 3 , 0, 0 , leftRight , true)
- //buildWall(6, 10, 1 , -18 , 0, -4 , leftRight , true)
- buildWall(6, 10, 1 , 11 , 0, -4 , leftRight , true)
- //buildWall(1, 10, 6 , -18 , 0, -4 , forwardBackward, true)
- //buildWall(1, 10, 1 , -17.5, 0, 7 , leftRight , true)
- //buildWall(1, 10, 13, -17 , 0, 8 , forwardBackward, true)
- //buildWall(1, 10, 2 , -12 , 0, -4 , forwardBackward, true)
- buildWall(1, 10, 2 , 11 , 0, -3 , forwardBackward, true)
- buildWall(1, 10, 6 , 16.5 , 0, -3 , forwardBackward, true)
- buildWall(6, 10, 1 , 11 , 0, 2 , leftRight , true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement