Post by code on Apr 3, 2018 20:50:15 GMT
Here the code:
''insert code here
nomainwin
WindowWidth=800
WindowHeight=600
schaal=0
afstand=0
afob=0
lef=0
dow=0
x=0
y=0
z=0
a=0
x1=0
y1=0
z1=0
plus=0
lift=120
tel=0
tel2=1
zetx=0
zety=0
tx1=0
ty1=0
tx2=0
ty2=0
tx3=0
ty3=0
tx4=0
ty4=0
dim p1x(900)
dim p1y(900)
dim p1z(900)
dim vp1x(900)
dim vp1y(900)
dim vp1z(900)
dim vp2x(900)
dim vp2y(900)
dim vp2z(900)
dim vp3x(900)
dim vp3y(900)
dim vp3z(900)
dim vp4x(900)
dim vp4y(900)
dim vp4z(900)
b=0
rx=0
ry=0
theta=0
phi=0
cosT=0
sinT=0
cosP=0
sinP=0
cosTcosP=0
cosTsinP=0
sinTcosP=0
sinTsinP=0
d=0
dow=-5
schaal=80 '100
afstand=18.8 '0.3
afob=4.9 '0.88
p1x(1)=-2
p1y(1)=2
p1z(1)=1
p1x(2)=-2
p1y(2)=6
p1z(2)=1
p1x(3)=2
p1y(3)=6
p1z(3)=1
p1x(4)=2
p1y(4)=2
p1z(4)=1
p1x(5)=-2
p1y(5)=2
p1z(5)=1
p1x(6)=2
p1y(6)=2
p1z(6)=1
p1x(7)=0
p1y(7)=-1
p1z(7)=1
p1x(8)=-2
p1y(8)=2
p1z(8)=1
p1x(9)=-2
p1y(9)=2
p1z(9)=0
p1x(10)=-2
p1y(10)=6
p1z(10)=0
p1x(11)=2
p1y(11)=6
p1z(11)=0
p1x(12)=2
p1y(12)=2
p1z(12)=0
p1x(13)=-2
p1y(13)=2
p1z(13)=0
p1x(14)=2
p1y(14)=2
p1z(14)=0
p1x(15)=0
p1y(15)=-1
p1z(15)=0
p1x(16)=-2
p1y(16)=2
p1z(16)=0
p1x(17)=2
p1y(17)=2
p1z(17)=1
p1x(18)=2
p1y(18)=6
p1z(18)=1
p1x(19)=2
p1y(19)=6
p1z(19)=0
p1x(20)=2
p1y(20)=2
p1z(20)=0
p1x(21)=0
p1y(21)=-1
p1z(21)=1
p1x(22)=2
p1y(22)=2
p1z(22)=1
p1x(23)=2
p1y(23)=2
p1z(23)=0
p1x(24)=0
p1y(24)=-1
p1z(24)=0
open "3D..." for graphics as #g
#g "trapclose [q]"
print #g, "fill black"
print #g, "flush"
timer 50, [t]
wait
[t]
plus=tel2
theta=3.14*plus/180
phi=3.14*lift/180
cosT =COS(theta)
sinT=SIN(theta)
cosP =COS(phi)
sinP=SIN(phi)
cosTcosP=cosT*cosP
cosTsinP=cosT*sinP
sinTcosP=sinT*cosP
sinTsinP=sinT*sinP
if d=0 then tel2=tel2-10
if d=1 then tel2=tel2-1
if d=2 then tel2=tel2+1
if d=3 then tel2=tel2
''#g "down"
''#g "color black; size 2"
''#g "place 0 0"
''#g "\Box 800x800"
#g, "fill black"
for a=1 to 24
tel=tel+1
x1 =cosT*(p1x(a)+lef) + sinT * p1z(a)
y1 = sinTsinP*(p1x(a)+lef) + cosP*(p1y(a)+dow) + cosTsinP*(p1z(a))
z1 = cosTcosP * p1z(a) - sinTcosP*(p1x(a)+lef) - sinP*(p1y(a)+dow)
x1 = x1*afstand/(p1z(a)+afstand+afob)
y1 = y1*afstand/(p1z(a)+afstand+afob)
rx=200/2+schaal*x1+0.5
ry=150/2-schaal*y1+0.5
if tel=1 then
tx1=rx
ty1=ry
end if
if tel=2 then
tx2=rx
ty2=ry
end if
if tel=3 then
tx3=rx
ty3=ry
end if
if tel=4 then
tx4=rx
ty4=ry
end if
zetx=180
zety=220
zetg=1000
if tel=4 then
#g "down"
#g "color blue; size 1"
#g "line ";tx1+zetx;" ";ty1+zety;" ";tx2+zetx;" ";ty2+zety;" "
#g "line ";tx2+zetx;" ";ty2+zety;" ";tx3+zetx;" ";ty3+zety;" "
#g "line ";tx3+zetx;" ";ty3+zety;" ";tx4+zetx;" ";ty4+zety;" "
#g "line ";tx4+zetx;" ";ty4+zety;" ";tx1+zetx;" ";ty1+zety;" "
end if
if tel=4 then
tel=0
tel2=tel2+1
end if
if tel2>360 then
tel2=1
end if
next
wait
[b1]
timer 0,[t]
wait
[q]
close #g
end