summaryrefslogtreecommitdiff
path: root/info/examples/lgc2/4-6-3.mp
blob: ee6c1c925181b7ef5d6f1d89713bf5034a9380b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
% --- start of displayed preamble in the book ---
input featpost3Dplus2D
% --- end of displayed preamble in the book ---
defaultfont:="ptmr8r";
warningcheck:=0;
beginfig(1)
Spread := 30;
f := 5.4*(1.5,0.5,1);
numeric gridstep, sidenumber,
        i, j, coord, aa, ab, ac;
color pa;
gridstep = 0.7;
sidenumber = 4;
coord = 0.5*sidenumber*gridstep;
for i=0 upto sidenumber:
  for j=0 upto sidenumber:
    pa := (-coord+j*gridstep,-coord+i*gridstep,0);
    aa := uniformdeviate(360);
    ab := uniformdeviate(180);
    ac := uniformdeviate(90);
    kindofcube(false, false,
               pa, aa, ab, ac, 0.4, 0.4, 0.9 );
  endfor;
endfor;
endfig;
end;