aUCBLogo Demos and Tests / testgradientfill
be testgradientfill
cs
s=1.5
bluehue=240
perspective
penUp
; enableDepthTest
disableDepthTest
; setLightAmbient RGB 1 1 1
enableLighting
setLabelFont [ArialBI]
setLabelAlign 1 1
setLightSpecular HSBA 0 0 1 1
setMaterialSpecular HSBA 240 0.3 1 1
setMaterialShininess 40
d=0
t=0
r=0
olda=0
;ignore [
alpha=0.15
for [a 0 335 25]
[ Home
left a fd 0.2 rt a
AT
]
disableLighting
alpha=0.15
for [a 0 335 25]
[ Home
left a fd 0.3 rt a
Rand
]
alpha=0.2
for [a 0 335 25]
[ Home
left a fd 0.1 rt a
; schreib
]
;]
ignore [
alpha=1
Home
AT
Home
; left a fd 0.3 rt a
; Rand
Home
; schreib
]
ht
rotatescene
be AT_old
left 135 fd 230*s rt 135
pd
blue 1
TessStart
blue .5
fd 200*s
rt 90
blue 0.3
fd 50*s
rt 45
blue 0.2
fd 50*s
left 90
blue 0.1
fd 50*s
rt 45
blue 0
fd 50*s
rt 90
blue .3
fd 200*s
rt 90
blue .7
fd 50*s
rt 90
blue .5
fd 130*s
left 90+45
blue .5
fd 50*s
rt 90
blue .6
fd 50*s
left 90+45
blue .9
fd 130*s
rt 90
blue 1
fd 50*s
rt 90
TessEnd
PU
fd 220*s
;left 90 fd 10 rt 90
PD
blue 1
TessStart
fd 50*s
rt 90
blue .3
fd 200*s
blue 0
fd 120*s
rt 90
blue .3
fd 50*s
rt 90
blue .4
fd 70*s
left 90
blue .7
fd 220*s
rt 90
blue 1
fd 50*s
rt 90
blue .6
fd 220*s
left 90
blue 1
fd 200*s
rt 90
blue 1
fd 50*s
TessEnd
PU fd 10 rt 90
black
PU
end
be AT_old2
left 135 fd 230*s rt 135
pd
TessStart
fd2 200*s
rt 90
fd2 50*s
rt 45
fd2 50*s
left 90
fd2 50*s
rt 45
fd2 50*s
rt 90
fd2 200*s
rt 90
fd2 50*s
rt 90
fd2 130*s
left 90+45
fd2 50*s
rt 90
fd2 50*s
left 90+45
fd2 130*s
rt 90
fd2 50*s
rt 90
TessEnd
PU
fd 220*s
;left 90 fd 10 rt 90
PD
TessStart
fd2 50*s
rt 90
fd2 160*s
fd2 160*s
rt 90
fd2 50*s
rt 90
fd2 70*s
left 90
fd2 220*s
rt 90
fd2 50*s
rt 90
fd2 220*s
left 90
fd2 200*s
rt 90
fd2 50*s
TessEnd
PU fd 10 rt 90
black
PU
end
be AT
d=40
t=20
r=10
olda=90
left 90 fd 20*s rt 90
left 135 fd 230*s rt 135+t
pd
TessStart
fd30 200*s 90-t
fd3 d*s 60+t
fd3 65*s -120
fd3 100*s 60-t
fd3 d*s 90+t
fd3 200*s 90-t
fd3 d*s 90+t
fd3 130*s -(90+60)
fd3 100*s 120
fd3 65*s -(90+60)
fd3 130*s 90-t
fd3 d*s 90+t
TessEnd
pu
back r*(tan abs olda/2)
fd 230*s
;left 90 fd 10 rt 90
PD
TessStart
fd3 d*s 90-t
fd3 (270+d)*s 90+t
fd3 d*s 90-t
fd3 70*s -(90-t)
fd3 220*s 90-t
fd3 (d*1.2)*s 90+t
fd3 220*s -(90+t)
fd3 (200-d*0.2)*s 90+t
fd3 d*s 0
TessEnd
PU fd 10 rt 90
end
be Rand
black
pu
left 90 fd 20*s rt 90
left 135 fd 230*s rt 135+t
setpensize [6 6] ;[3 3]
olda=90
pd
fd5 200*s 90-t
fd4 d*s 60+t
fd4 65*s -120
fd4 100*s 60-t
fd4 d*s 90+t
fd4 200*s 90-t
fd4 d*s 90+t
fd4 130*s -(90+60)
fd4 100*s 120
fd4 65*s -(90+60)
fd4 130*s 90-t
fd4 d*s 90+t
pu
back r*(tan abs olda/2)
fd 230*s
;left 90 fd 10 rt 90
PD
fd4 d*s 90-t
fd4 (270+d)*s 90+t
fd4 d*s 90-t
fd4 70*s -(90-t)
fd4 220*s 90-t
fd4 (d*1.2)*s 90+t
fd4 220*s -(90+t)
fd4 (200-d*0.2)*s 90+t
fd4 d*s 90-t
PU fd 10 rt 90
black
PU
end
be fd2 l
pu
fd l
; show sqrt (sqr xcor/(500*s)+0.5)+(sqr ycor/(500*s)+0.5)
blue sqrt (sqr xcor/(500*s)+0.5)+(sqr ycor/(500*s)+0.5)
pd fd 0
end
be fd3 l a
pu
fd l-r*((tan abs olda/2)+tan abs a/2)
; (print 0.5-xcor/(400*s) 0.3-ycor/(300*s))
; print sqrt (sqr 0.5-xcor/(400*s))+(sqr 0.3-ycor/(300*s))
blue sqrt (sqr 0.5-xcor/(400*s))+(sqr 0.3-ycor/(300*s))
pd fd 0
olda=a
ifelse a < 0
[ left2 -a
][ rt2 a
]
end
be fd30 l a
pu
fd l-r*((tan abs olda/2)+tan abs a/2)
; show sqrt (sqr xcor/(500*s)+0.5)+(sqr ycor/(500*s)+0.5)
blue sqrt (sqr xcor/(500*s)+0.5)+(sqr ycor/(500*s)+0.5)
pd fd 0
olda=a
ifelse a < 0
[ left2 -a
][ rt2 a
]
end
be fd4 l a
pd
fd l-r*((tan abs olda/2)+tan abs a/2)
; show sqrt (sqr xcor/(500*s)+0.5)+(sqr ycor/(500*s)+0.5)
olda=a
ifelse a < 0
[ left2 -a
][ rt2 a
]
end
be fd5 l a
pd
fd l-r*((tan abs olda/2)+tan abs a/2)
olda=a
ifelse a < 0
[ left2 -a
][ rt2 a
]
end
be rt2 a
; rt a
arc2 a r
end
be left2 a
; left a
arc2 -a -r
end
be schreib
left 135 fd 230*s rt 135+t
fd 265*s rt 90-t
PD
setLabelSize (list 30 30)*s
label [EDELSTAHL]
PU fd 260*s rt 90+t fd 50*s PD
vlabel [G L A S]
PU
home
setLabelSize [80 80]
fd 10*s right 90 fd 80*s label [&]
end
be vlabel chars
foreach chars
[ pu fd 50*s pd
left 90+t-7
label ?
right 90+t-7
]
end
be blue f
setPC HSBA bluehue f 0.9 alpha
end
be black
setPC RGBA 0 0 0 alpha
end
end
be rotatescene [dphi 1][singleshot false][phi 0]
local [eye ddphi theta dtheta center upvector rotatescene_r dr]
eye=array 3
theta=30
dtheta=5
center={0 0 0}
upvector={0 1 0}
ddphi=dphi/3
rotatescene_r=500
dr=1.1
pr [left, right changes rotation speed, up down set pitch, ESC exits]
dispatchMessages
forever
[ eye.1=rotatescene_r*(cos theta)*sin phi
eye.2=rotatescene_r* sin theta
eye.3=rotatescene_r*(cos theta)*cos phi
setEye eye center upvector
setLightPos {00 50 100}
redraw
if singleshot [break]
phi=phi+dphi
while [key?]
[ dispatchMessages
local [ch]
ch=readChar
ifelse ch==char 255
[ ch=readCharExt
if ch==WXK_RIGHT [dphi=dphi+ddphi]
if ch==WXK_LEFT [dphi=dphi-ddphi]
if ch==WXK_UP [theta=theta+dtheta]
if ch==WXK_DOWN [theta=theta-dtheta]
if ch==WXK_PRIOR [rotatescene_r=rotatescene_r/dr]
if ch==WXK_NEXT [rotatescene_r=rotatescene_r*dr]
][
if ch==char 27 [stop]
if ch=="+ [rotatescene_r=rotatescene_r-dr]
if ch=="- [rotatescene_r=rotatescene_r+dr]
]
]
]
end