aUCBLogo Demos and Tests / some_polyhedra
to some_polyhedra
perspective
hideTurtle
clearScreen
setpensize 5
enablecylinderlines
; setScreenRange -500 -500 500 500
; disableLighting
; disableDepthTest
draw_scene
; enableLighting
; enableDepthTest
; draw_scene
rotatescene
setSaveSize [2000 2000]
; savescreen "test.png
savescreenvector "test.svg
end
to draw_scene
setPenColor HSBA 120 1 1 0.5
size=100
angle2=20
right 90
back size
tetrahedron size 108
fd size*2
down 180
rightroll angle2
tetrahedron size 108
end
to tetrahedron size angle
; penup
fd size
v1=PosXYZ
back size
down angle
fd size
v2=PosXYZ
back size
up angle
rightroll 120
down angle
fd size
v3=PosXYZ
back size
up angle
rightroll 120
down angle
fd size
v4=PosXYZ
back size
up angle
drawface v1 v2 v3
setPenColor HSBA 120 1 1 0.5
drawface v2 v3 v4
setPenColor HSBA 125 1 1 0.5
drawface v3 v4 v1
setPenColor HSBA 120 1 1 0.5
drawface v4 v1 v2
end
to drawface a b c
oldpos=PosXYZ
penup
setPosXYZ a
pendown
Polygon
[ setPosXYZ b
setPosXYZ c
setPosXYZ a
]
penup
setposXYZ oldpos
end