Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- camera
- {
- location <0, 20, -20>
- look_at <0, 0, 0>
- }
- light_source
- {
- <10, 20, -20>
- color rgb <1, 1, 1>
- }
- #macro createLego(varX, varY, varZ, varWidth, varHeight, varLength, varRot, varColor)
- #declare cylinderHeight = .3;
- object
- {
- merge
- {
- box
- {
- <-varWidth / 2, -varHeight / 2, -varLength / 2>
- < varWidth / 2, varHeight / 2, varLength / 2>
- pigment
- {
- color rgb varColor
- }
- }
- #declare vx = 1;
- #declare vy = 1;
- #declare vz = 1;
- #while (vz < varLength * 2)
- #while (vx < varWidth * 2)
- cylinder
- {
- <(-varWidth / 2) + (varWidth * (vx / (varWidth * 2))), (varHeight / 2) , (-varLength / 2) + (varLength * (vz / (varLength * 2)))>
- <(-varWidth / 2) + (varWidth * (vx / (varWidth * 2))), (varHeight / 2) + .3, (-varLength / 2) + (varLength * (vz / (varLength * 2)))>
- .375
- pigment
- {
- color rgb varColor
- }
- }
- #declare vx = vx + 2;
- #end
- #declare vx = 1;
- #declare vz = vz + 2;
- #end
- }
- rotate varRot
- translate <varX + (varWidth / 2), varY + (varHeight / 2), varZ + (varLength / 2)>
- }
- #end
- //createLego(0, 0, 0,
- // 4, 2, 2,
- // <180, 0, 0>,
- // <1, 0, 0>)
- //
- //createLego(2, 0, -2,
- // 4, 2, 2,
- // <0, 0, 0>,
- // <0, 0, 1>)
- createLego(0, 0, 0,
- 2, 2, 4,
- <0, 0, 0>,
- <0, 0, 1>)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement