| 1 |
.PS |
| 2 |
# shapesDPV.m4 |
| 3 |
threeD_init |
| 4 |
include(../Shapedefs.m4) |
| 5 |
|
| 6 |
azimuth = 60 |
| 7 |
elev = 10 |
| 8 |
setview(azimuth,elev) |
| 9 |
[ Orig: (0,0) |
| 10 |
setlight |
| 11 |
Arrow3D(1,0,0) with .Start at Orig; move left 12bp__ from last [].End "x" |
| 12 |
Arrow3D(0,1,0) with .Start at Orig; "y" ljust at last [].End |
| 13 |
Arrow3D(0,0,1.2) with .Start at Orig; "z" above at last [].End |
| 14 |
setlight(0,0,0) |
| 15 |
cylinder3D(1,1,1,0.6) with .Start at Project(0.5,0.5,0.5) |
| 16 |
] |
| 17 |
Ball: shadedball(0.5) with .nw at last [].ne+(-0.25,0) |
| 18 |
[ |
| 19 |
setview(45,10) |
| 20 |
setlight(40,70) |
| 21 |
n = 9; len = 1.5; thmin = m4azim+pi_/2*0.8; thmax = thmin+twopi_ |
| 22 |
for i=0 to n do { |
| 23 |
r = i/n*(thmax-thmin)+thmin |
| 24 |
prism3D(rot3Dz(r,rot3Dy(pi_/4,len,0,0)),0.2,0.1) \ |
| 25 |
with .Start at Project(rot3Dz(r,rot3Dy(pi_/4,len*0.5,0,0))) } |
| 26 |
] with .nw at last [].ne |
| 27 |
[ |
| 28 |
setlight(0,0) |
| 29 |
movewid = 0.1 |
| 30 |
len = 1.5; ni = 5; nj = 5 |
| 31 |
for i=1 to ni-1 do { |
| 32 |
{for j = 0 to nj by 2 do { |
| 33 |
setview(0,i/ni*180-90,j/nj*90) |
| 34 |
cylinder3D(0,0,len*(j+1)/(nj+1),0.4) |
| 35 |
if j < nj then {move right} } } |
| 36 |
if i < ni then {move down 0.85; right_} } #else { move down movewid } } |
| 37 |
] with .nw at 1st [].sw+(0,-0.1) |
| 38 |
[ |
| 39 |
setlight(0,0) |
| 40 |
len = 1.5; ni = 4; nj = 6 |
| 41 |
for i=1 to ni do { |
| 42 |
{for j = 0 to nj by 2 do { |
| 43 |
setview(0,i/ni*180-90,j/nj*90) |
| 44 |
cone3D(0,0,len*(j+1)/(nj+1),0.4) |
| 45 |
if i==2 && j==(nj-2) then { move up_ 0.2 right_ -0.4 } \ |
| 46 |
else { if j < nj then {move right_ 0.1}} } } |
| 47 |
if i < ni then {move down_ 0.75; right_} } |
| 48 |
] with .nw at last [].ne+(0.2,0) |
| 49 |
.PE |