這段時間,随着北京冬奧會的開幕,吉祥物“冰墩墩”可謂是超級火,多少人排隊都買不到,既然買不到,那就給大家出一個Python版冰墩墩。
為了幫助大家早日實現“一戶一墩”,八百裡加急,給大家出這個
Python版“冰墩墩”
話不多說,先上效果圖
說實話,這個沒什麼技術含量,就是硬寫,不斷調整曲線細節,用python自帶的turtle庫來畫圖。
由于代碼比較長!給大家展示主要核心代碼!上教程
左手
turtle.penup()turtle.goto(177, 112)turtle.pencolor("lightgray")turtle.pensize(3)turtle.fillcolor("white")turtle.begin_fill()turtle.pendown()turtle.setheading(80)turtle.circle(-45, 200)turtle.circle(-300, 23)
左手内
turtle.penup()turtle.goto(182, 95)turtle.pencolor("black")turtle.pensize(1)turtle.fillcolor("black")turtle.begin_fill()turtle.setheading(95)turtle.pendown()turtle.circle(-37, 160)turtle.circle(-20, 50)turtle.circle(-200, 30)
頭頂
turtle.penup()turtle.goto(-73, 230)turtle.pencolor("lightgray")turtle.pensize(3)turtle.fillcolor("white")turtle.begin_fill()turtle.pendown()turtle.setheading(20)turtle.circle(-250, 35)
左耳
turtle.setheading(50)turtle.circle(-42, 180)
左側
turtle.setheading(-50)turtle.circle(-190, 30)turtle.circle(-320, 45)
左腿
turtle.circle(120, 30)turtle.circle(200, 12)turtle.circle(-18, 85)turtle.circle(-180, 23)turtle.circle(-20, 110)turtle.circle(15, 115)turtle.circle(100, 12)
右腿
turtle.circle(15, 120)turtle.circle(-15, 110)turtle.circle(-150, 30)turtle.circle(-15, 70)turtle.circle(-150, 10)turtle.circle(200, 35)turtle.circle(-150, 20)
右手
turtle.setheading(-120)turtle.circle(50, 30)turtle.circle(-35, 200)turtle.circle(-300, 23)
右側turtle.setheading(86)turtle.circle(-300, 26)
右耳turtle.setheading(122)turtle.circle(-53, 160)turtle.end_fill()
,更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!