File: bars3.asy

package info (click to toggle)
asymptote 3.09%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,392 kB
  • sloc: cpp: 282,597; ansic: 69,697; python: 15,252; sh: 5,888; perl: 3,006; makefile: 1,719; lisp: 1,507; yacc: 614; lex: 449; xml: 182; javascript: 79; asm: 8
file content (22 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import three;
import palette;
import graph3;

size(300);

currentprojection=perspective(-30,-30,30,up=Z);

surface s;

for(int i = 0; i < 10; ++i) {
  for(int j = 0; j < 10; ++j) {
    s.append(shift(i,j,0)*scale(1,1,i+j)*unitcube);
  }
}

s.colors(palette(s.map(zpart),Rainbow()));
draw(s,meshpen=black+thick(),nolight,render(merge=true));

xaxis3("$x$",Bounds,InTicks(endlabel=false,Label,2,2));
yaxis3(YZ()*"$y$",Bounds,InTicks(beginlabel=false,Label,2,2));
zaxis3(XZ()*"$z$",Bounds,InTicks);