Question: # This function paints ONE anime eyeball on the Canvas, centered at . The color of the iris is NewColor, the pupil is black, and

# This function paints ONE anime eyeball on the Canvas, centered at . The color of the iris is NewColor, the pupil is black, and the highlights are white. The sizes and positions of the iris, pupil, starburst, and highlights are derived from center point and the radius R of the iris. #

def Eyeball (Canvas,Xc,Yc,R,NewColor): return

In the Eyeball function (see above), write new code to paint a single anime eyeball on the canvas, given the center of the circle is at location , with iris radius R and iris color NewColor (all of this is passed in through the parameter list). In Eyeball, you will need to call the addCircleFilled function four times, once for the iris, once for the pupil, and once for each of the two highlights.

The radius of the iris (the colored area) comes directly from parameter R. The radius of the pupil (the black center of the eye) is half the radius of the iris, and has the same center coordinates as the iris. The radius of the big highlight (the big white spot) is one-quarter that of the iris. The radius of the smaller highlight is one-seventh that of the iris. The centers of the highlights are located relative to the center of the eyeball at a distance offset in the X and Y directions by an amount calculated as follows: Offset = 1/4 R sq rt

This will put the center of the highlights directly on the boundary between the pupil and the iris, at 45 degree angles relative to the center of the pupil. You will also have to call addStarburst at the appropriate time. The starburst has the same center coordinates as the pupil and the iris. The inner radius is R (the radius of the pupil) plus 1 15 TH of R, and the outer radius is R minus 1 15th of R. There are 40 segments in the starburst.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!