aUCBLogo Demos and Tests / ladybug
			
				
			
			to ladybug
   ;by Michael Malien (only a bit changed)
   cs
   perspective
   enCL
;   setEye {0 0 200}{0 0 0}{0 1 0}
;   setLightPos {1000 1000 1000}
   setPC [.9 .2 0]
   partialEllipsoid 70 50 100  -90 90 50  0 -180 50
   dots
   feet_middle
   seth 0
   head
   seth 0
   pd bk 100+70-5
   feet_back
   
   seth 0
   setfc [1 0 0] 
   make "pos_ posXYZ
   pu lt 45 fd 20; fill
   setposXYZ :pos_
   
   seth 0
   setfc [1 0 0] 
   make "pos_ posXYZ
   pu rt 45 fd 20; fill
   setposXYZ :pos_
   
   seth 0 
   home ht
   
;   repeat 120 [scrolly 1]
   rotatescene
end
to head
   pu setxy 0 108
   setfc [0 0 0]
   pd fillEllipse 15 10
   eyes
   pu setx 0
   
   setpc [0 0 0]
   fd 8
   setpensize [3 3]
   sensors
   bk 60
   partialEllipsoid 50 50 45  -90 90 50  0 -180 50
   fd 10
   feet_fore
end
to eyes
   setpc [1 1 0] 
   pu setx -10 pd Ellipsoid 5 5 5 setpixel2
   setpc [1 1 0]
   pu setx  10 pd Ellipsoid 5 5 5 setpixel2
end
to sensors
   pd lt 30 fd 10 bk 10 rt 30
   rt 30 fd 10 bk 10 lt 30 pu
end
to setpixel2
   setpixel [0 0] 0 fd 1 setpixel [0 0] 0 bk 1
end
to dot x y z
   setXYZ x y z
   setOrientation towardsXYZ [0 0 0]
   pd Ellipsoid 16 5 16 pu
end
to ddot x y z
   dot  x y z
   dot -x y z
end
to dots
   setpc [0 0 0]
   pu 
   dot 0 35 50
   ddot 48 20 40
   ddot 21 -10 45
   ddot 32 -50 40
   pu home
end
to feet_middle
   make "b 70
   fd 8
   make "y1 ycor
   foot_l :b
   bk 8
   pu setxy 0 :y1
   foot_r :b
end
to feet_back
   make "b 25
   fd 6
   make "y1 ycor
   foot_l :b
   bk 6
   pu setxy 0 :y1
   foot_r :b
end
to feet_fore
   make "b 50
   make "y1 ycor
   foot_lf :b
   pu setxy 0 :y1
   foot_rf :b
end
to foot_l :b
   pu setxy -:b ycor
   pd
   setpensize [5 5]
   seth -140
   fd 40
   rt 30
   fd 20
end
to foot_r :b
   pu setxy :b ycor
   pd
   setpensize [5 5]
   seth 140
   fd 40
   lt 30
   fd 20
   pu setxy 0 :y1
end
to foot_lf :b
   pu setxy -:b ycor
   pd
   setpensize [5 5]
   seth -20
   fd 40
   lt 30
   fd 20
end
to foot_rf :b
   pu setxy :b ycor
   pd
   setpensize [5 5]
   seth 20
   fd 40
   rt 30
   fd 20
   pu setxy 0 :y1
end