%!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: -150 -150 150 150 % この数値を適当に動かすことで回転する /r 0 def % y軸中心に回転 /xzr { /z exch def /y exch def /x exch def x r cos mul z r sin mul add y x r sin mul -1 mul z r cos mul add } def % 3次元座標を2次元に射影し、拡大 /trj { /z exch def /y exch def /x exch def x 100 mul z -70.7 mul add y 100 mul z -70.7 mul add } def % 回転と射影を組み合わせる /dsp { /z exch def /y exch def /x exch def x y z xzr trj } def % 6個の頂点を定義 /xp {1 0 0} def /yp {0 1 0} def /zp {0 0 1} def /xm {-1 0 0} def /ym {0 -1 0} def /zm {0 0 -1} def % 頂点を結んで8個の三角形を描く newpath xp dsp moveto yp dsp lineto zp dsp lineto closepath stroke newpath xm dsp moveto yp dsp lineto zp dsp lineto closepath stroke newpath xp dsp moveto ym dsp lineto zp dsp lineto closepath stroke newpath xp dsp moveto yp dsp lineto zm dsp lineto closepath stroke newpath xp dsp moveto ym dsp lineto zm dsp lineto closepath stroke newpath xm dsp moveto yp dsp lineto zm dsp lineto closepath stroke newpath xm dsp moveto ym dsp lineto zp dsp lineto closepath stroke newpath xm dsp moveto ym dsp lineto zm dsp lineto closepath stroke %%EOF