`PMX demonstration. Requires PMX 15.44B or later. proj tree enter pmx /direct card b,bt,bc,m real l1,t1,v1,l2,t2,v2,d1,d2 real l0, t0, v0 real v10 real a real dl real tf real pi:=3.14159 macro tree .presents %1 .star %1, %2 b:=0 bc:=0 bt:=0 l1:=l0 t1:=t0 v1:=v0 l2:=l1 t2:=t1 v2:=v1+%1 d1:=%2 d2:=%2/3 .trunk macro branch1a v1:=v0 a:=2.*pi*%%91/%%92 .branch1 (m,1) 1, %1/6, (%1*0.9)/m, %2/3 // .branch1a (5,1) 0, 5 .render / macro branch1 l1:=l0 t1:=t0 dl:=%2*(5*m/(2*m+5*%1)) a:=a+2.*pi/m l2:=l1+dl*COS(a) t2:=l1+dl*SIN(a) v1:=v1+%3 v2:=v1+dl/3 d1:=%4 d2:=d1/3 .branch l1:=l0 v10:=v1 card n:=m/2 .twigs (n,1) 1, l2/n, t2/n, dl/3, %2 v1:=v10 / macro twigs l1:=l1+%2 t1:=t1+%3 v1:=v10+%1*%4/n d1:=%5/20 d2:=d1/4 tf:=%5/6 macro twigs1 t2:=t1+SIN(a%%91pi/2)*tf l2:=l1+COS(a%%91pi/2)*tf v2:=v1 .twig // .twigs1 "+" .twigs1 "-" macro twigs1 t2:=t1 l2:=l1 v2:=v1%%91tf .twig // .twigs1 "+" if %1=n then .twigs1 "-" end / macro trunk .cyl "TRUNK.S", l1, t1, v1, l2, t2, v2, d1, d2 / macro branch b:=b+1 bc:=bc+1 if bc>5 then bc:=1 end .cyl "BRANCH"+b+".S", l1, t1, v1, l2, t2, v2, d1, d2 .sphere "BALL"+bc+"_"+b+".S", l2,t2,v2-d1*2.5, d1*2.5 bt:=0 / macro twig set bt=bt+1 .cyl "BRANCH"+b+".S\TWIG"+bt+".S", l1, t1, v1, l2, t2, v2, d1, d2 / macro cyl create %1 inboard -500 cyl (4) %2,%3,%4, %5,%6,%7, %8, %9 // / macro sphere create %1 inboard -500 sph (8) %2,%3,%4, %5 // / macro presents .ship "FV", 0, %1/8, "blue" .ship "TANKER", %1/5, -3*%1/40, "orange" .ship "SV", %1/10, %1/20, "green" / macro ship read {PROGDIR}+"%1.GF" unit=feet scale 1/4, 1/4, 1/4 shift %2, %3, 0 rename hull, %1hull surface ($DISPLACERS) 99 %1; color:%4; opacity:1.0 clear / macro star real r[1] r[0]:=%2 r[1]:=r[0]/2 card i:=0 l2:=l0 t2:=t0 v2:=v0+%1+r[0]*2 d1:=%2/5 a:=0. .star1 (11,1) 0, %1+r[0] surface (star) 99 star; color:yellow / macro star1 l1:=l2 t1:=t2 v1:=v2 t2:=r[i]*SIN(a) v2:=%2+r[i]*COS(a) a:=a+pi/5 i:=1-i create star\star%1.s inb -100 cyl (8) l1, t1, v1, l2, t2, v2, d1 // / macro render macro surf surface (%%91*) 99 %%91; color:%%92 // .surf "TRUNK", "brown" .surf "BRANCH", "green" .surf "BALL1", "brightred" .surf "BALL2", "brightblue" .surf "BALL3", "brightcyan" .surf "BALL4", "brightmagenta" .surf "BALL5", "yellow" render trunk, branch, ball1,ball2,ball3,ball4,ball5, star, fv,tanker,sv; WPL:0,0,0; CAM:230,10; JPEG:tree.jpg; size:600,900 / l0:=0. t0:=0. v0:=0. m:=14 .tree 200., 8. `height, trunk diam clear quit pm