dos33fsprogs/basic/cube/cube.bas

27 lines
926 B
QBasic
Raw Normal View History

2021-03-29 11:58:01 +00:00
10 RX=-0.1
20 L=80:FS=200:L=L/2
35 HGR:HCOLOR=3
40 X(1)=-L:Y(1)=-L:Z(1)=-L
50 X(2)=-L:Y(2)=L:Z(2)=-L
60 X(3)=L:Y(3)=L:Z(3)=-L
70 X(4)=L:Y(4)=-L:Z(4)=-L
80 X(5)=-L:Y(5)=-L:Z(5)=L
90 X(6)=-L:Y(6)=L:Z(6)=L
100 X(7)=L:Y(7)=L:Z(7)=L
110 X(8)=L:Y(8)=-L:Z(8)=L
120 RX=RX+0.1:C=COS(RX):S=SIN(RX)
130 FOR NP=1 TO 8
140 YT=Y(NP):Y(NP)=C*YT-S*Z(NP):Z(NP)=S*YT+C*Z(NP)
150 XT=X(NP):X(NP)=C*XT+S*Z(NP):Z(NP)=-S*XT+C*Z(NP)
160 XT=X(NP):X(NP)=C*XT-S*Y(NP):Y(NP)=S*XT+C*Y(NP)
170 VX(NP)=160+(X(NP)*FS)/(X(NP)+FS)
180 VY(NP)=100+(Y(NP)*FS)/(Z(NP)+FS)
190 NEXT
200 HPLOT VX(1),VY(1) TO VX(2),VY(2) TO VX(3),VY(3) TO VX(4),VY(4) TO VX(1),VY(1)
210 HPLOT VX(5),VY(5) TO VX(6),VY(6) TO VX(7),VY(7) TO VX(8),VY(8) TO VX(5),VY(5)
220 HPLOT VX(8),VY(8) TO VX(5),VY(5):HPLOT VX(1),VY(1) TO VX(5),VY(5)
230 HPLOT VX(4),VY(4) TO VX(8),VY(8):HPLOT VX(2),VY(2) TO VX(6),VY(6)
240 HPLOT VX(3),VY(3) TO VX(7),VY(7)
245 GET A$:IF A$="Q" THEN END
250 GOTO 35