鱼C论坛

 找回密码
 立即注册
查看: 4826|回复: 15

[作品展示] 送你一只冰墩墩

[复制链接]
发表于 2022-2-19 17:53:03 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本作品使用python turtle库进行绘制,可在idle,pycharm下面直接打开~
最终效果图

                               
登录/注册后可看大图

python源代码:
  1. # python绘制2022冬奥会吉祥物--冰墩墩

  2. import turtle as t
  3. from time import sleep

  4. # 是否显示绘画过程
  5. # t.tracer(False)

  6. t.setup(800, 600)  # 设置窗体大小
  7. t.title('冰墩墩')    # 更改窗口默认标题
  8. t.speed(20)  # 设置画笔移动速度
  9. # t.bgpic('dd.png')  # 找到一张简笔画,开始疯狂的测算描边
  10. # 隐藏光标
  11. t.hideturtle()

  12. # 画出大致轮廓
  13. #
  14. #
  15. # 画脑门
  16. t.penup()  # 抬起画笔,不留下痕迹
  17. t.goto(-73, 230)  # 设置起点
  18. t.pencolor('lightgray')  # 画笔颜色
  19. t.pensize(3)  # 画笔宽度
  20. t.fillcolor('white')   # 绘制图形的填充色
  21. t.begin_fill() # 从此处落笔开始,准备填充图形
  22. t.pendown()    # 画笔落下,留下痕迹
  23. t.setheading(20)   # 以 x 轴正方向为基准,设置当前朝向为 angle 角度
  24. t.circle(-250, 35) # 画圆,1.半径;2.偏移角度
  25. #
  26. # 右耳
  27. t.setheading(50)
  28. t.circle(-42,180)
  29. #
  30. # 右侧脸与右侧肚子
  31. t.setheading(-50)
  32. t.circle(-190,30)
  33. t.circle(-320,45)
  34. #
  35. # 右脚
  36. t.circle(120,30)
  37. t.circle(200,12)
  38. t.circle(-18,85)
  39. t.circle(-180,23)
  40. t.circle(-20,110)
  41. #
  42. # 裤裆
  43. t.circle(15,115)
  44. t.circle(100, 12)
  45. t.circle(15, 120)
  46. #
  47. # 左脚
  48. t.circle(-15, 110)
  49. t.circle(-150, 30)
  50. t.circle(-15, 70)
  51. t.circle(-150, 10)
  52. #
  53. # 左侧肚子
  54. t.circle(200, 35)
  55. t.circle(-150, 20)
  56. #
  57. # 左手
  58. t.setheading(-120)
  59. t.circle(50, 30)
  60. t.circle(-35, 200)
  61. t.circle(-300, 23)
  62. #
  63. # 左侧脸
  64. t.setheading(86)
  65. t.circle(-300, 26)
  66. #
  67. # 左耳
  68. t.setheading(122)
  69. t.circle(-53, 160)
  70. t.end_fill()
  71. #
  72. # 补上右手
  73. t.penup()
  74. t.goto(177, 112)
  75. t.pencolor("lightgray")
  76. t.pensize(3)
  77. t.fillcolor("white")
  78. t.begin_fill()
  79. t.pendown()
  80. t.setheading(80)
  81. t.circle(-45, 200)
  82. t.circle(-300, 23)
  83. t.end_fill()
  84. #
  85. #
  86. # 画脸上的彩虹圈
  87. t.penup()
  88. t.goto(-135, 120)
  89. t.pensize(5)
  90. t.pencolor("cyan")
  91. t.pendown()
  92. t.setheading(60)
  93. t.circle(-165, 150)
  94. t.circle(-130, 78)
  95. t.circle(-250, 30)
  96. t.circle(-138, 105)
  97. t.penup()
  98. t.goto(-131, 116)
  99. t.pencolor("slateblue")
  100. t.pendown()
  101. t.setheading(60)
  102. t.circle(-160, 144)
  103. t.circle(-120, 78)
  104. t.circle(-242, 30)
  105. t.circle(-135, 105)
  106. t.penup()
  107. t.goto(-127, 112)
  108. t.pencolor("orangered")
  109. t.pendown()
  110. t.setheading(60)
  111. t.circle(-155, 136)
  112. t.circle(-116, 86)
  113. t.circle(-220, 30)
  114. t.circle(-134, 103)
  115. t.penup()
  116. t.goto(-123, 108)
  117. t.pencolor("gold")
  118. t.pendown()
  119. t.setheading(60)
  120. t.circle(-150, 136)
  121. t.circle(-104, 86)
  122. t.circle(-220, 30)
  123. t.circle(-126, 102)
  124. t.penup()
  125. t.goto(-120, 104)
  126. t.pencolor("greenyellow")
  127. t.pendown()
  128. t.setheading(60)
  129. t.circle(-145, 136)
  130. t.circle(-90, 83)
  131. t.circle(-220, 30)
  132. t.circle(-120, 100)
  133. t.penup()
  134. #
  135. #
  136. # 眼睛部分
  137. #
  138. # 左黑眼圈
  139. t.penup()
  140. t.goto(-64, 120)
  141. t.pencolor("black")
  142. t.pensize(1)
  143. t.fillcolor('black')
  144. t.begin_fill()
  145. t.pendown()
  146. t.setheading(40)
  147. t.circle(-35, 152)
  148. t.circle(-100, 50)
  149. t.circle(-35, 130)
  150. t.circle(-100, 50)
  151. t.end_fill()
  152. #
  153. # 右黑眼圈
  154. t.penup()
  155. t.goto(51, 82)
  156. t.fillcolor()
  157. t.begin_fill()
  158. t.pendown()
  159. t.setheading(120)
  160. t.circle(-32, 152)
  161. t.circle(-100, 55)
  162. t.circle(-25, 120)
  163. t.circle(-120, 45)
  164. t.end_fill()
  165. #
  166. #
  167. # 填充黑色部分,从右耳开始,填充至右手
  168. #
  169. #
  170. # 右耳黑
  171. t.penup()
  172. t.goto(90, 230)
  173. t.pencolor('black')
  174. t.pensize(1)
  175. t.setheading(40)
  176. t.fillcolor('black')
  177. t.begin_fill()
  178. t.pendown()
  179. t.circle(-30, 170)
  180. t.setheading(125)
  181. t.circle(150, 23)
  182. t.end_fill()
  183. #
  184. # 左耳黑
  185. t.penup()
  186. t.goto(-130, 180)
  187. t.pencolor()
  188. t.pensize(1)
  189. t.fillcolor()
  190. t.begin_fill()
  191. t.pendown()
  192. t.setheading(120)
  193. t.circle(-28, 160)
  194. t.setheading(210)
  195. t.circle(150, 20)
  196. t.end_fill()
  197. #
  198. # 左手黑
  199. t.penup()
  200. t.goto(-180, -55)
  201. t.fillcolor()
  202. t.begin_fill()
  203. t.setheading(-120)
  204. t.pendown()
  205. t.circle(50, 30)
  206. t.circle(-27, 200)
  207. t.circle(-300, 20)
  208. t.setheading(-90)
  209. t.circle(300, 14)
  210. t.end_fill()
  211. #
  212. # 左脚黑
  213. t.penup()
  214. t.goto(-38, -210)
  215. t.fillcolor()
  216. t.begin_fill()
  217. t.pendown()
  218. t.setheading(-155)
  219. t.circle(15, 100)
  220. t.circle(-10, 110)
  221. t.circle(-100, 30)
  222. t.circle(-15, 65)
  223. t.circle(-100, 10)
  224. t.circle(200, 15)
  225. t.setheading(-14)
  226. t.circle(-200, 27)
  227. t.end_fill()
  228. #
  229. # 右脚黑
  230. t.penup()
  231. t.goto(108, -168)
  232. t.fillcolor()
  233. t.begin_fill()
  234. t.pendown()
  235. t.setheading(-115)
  236. t.circle(110, 15)
  237. t.circle(200, 10)
  238. t.circle(-18, 80)
  239. t.circle(-180, 13)
  240. t.circle(-20, 90)
  241. t.circle(15, 60)
  242. t.setheading(42)
  243. t.circle(-200, 29)
  244. t.end_fill()
  245. #
  246. # 右手内部
  247. t.penup()
  248. t.goto(182, 95)
  249. t.pencolor()
  250. t.pensize(1)
  251. t.fillcolor()
  252. t.begin_fill()
  253. t.setheading(95)
  254. t.pendown()
  255. t.circle(-37, 160)
  256. t.circle(-20, 50)
  257. t.circle(-200, 30)
  258. t.end_fill()
  259. #
  260. #
  261. # 画龙点睛作用
  262. #
  263. # 左眼珠子
  264. t.penup()
  265. t.goto(-47, 55)
  266. t.fillcolor("white")
  267. t.begin_fill()
  268. t.pendown()
  269. t.setheading(0)
  270. t.circle(25, 360)
  271. t.end_fill()
  272. t.penup()
  273. t.goto(-45, 62)
  274. t.pencolor("darkslategray")
  275. t.fillcolor("darkslategray")
  276. t.begin_fill()
  277. t.pendown()
  278. t.setheading(0)
  279. t.circle(19, 360)
  280. t.end_fill()
  281. t.penup()
  282. t.goto(-45, 68)
  283. t.fillcolor("black")
  284. t.begin_fill()
  285. t.pendown()
  286. t.setheading(0)
  287. t.circle(10, 360)
  288. t.end_fill()
  289. t.penup()
  290. t.goto(-47, 86)
  291. t.pencolor("white")
  292. t.fillcolor("white")
  293. t.begin_fill()
  294. t.pendown()
  295. t.setheading(0)
  296. t.circle(5, 360)
  297. t.end_fill()
  298. #
  299. # 右眼珠子
  300. t.penup()
  301. t.goto(79, 60)
  302. t.fillcolor("white")
  303. t.begin_fill()
  304. t.pendown()
  305. t.setheading(0)
  306. t.circle(24, 360)
  307. t.end_fill()
  308. t.penup()
  309. t.goto(79, 64)
  310. t.pencolor("darkslategray")
  311. t.fillcolor("darkslategray")
  312. t.begin_fill()
  313. t.pendown()
  314. t.setheading(0)
  315. t.circle(19, 360)
  316. t.end_fill()
  317. t.penup()
  318. t.goto(79, 70)
  319. t.fillcolor("black")
  320. t.begin_fill()
  321. t.pendown()
  322. t.setheading(0)
  323. t.circle(10, 360)
  324. t.end_fill()
  325. t.penup()
  326. t.goto(79, 88)
  327. t.pencolor("white")
  328. t.fillcolor("white")
  329. t.begin_fill()
  330. t.pendown()
  331. t.setheading(0)
  332. t.circle(5, 360)
  333. t.end_fill()
  334. #
  335. # 大黑鼻子
  336. t.penup()
  337. t.goto(37, 80)
  338. t.fillcolor("black")
  339. t.begin_fill()
  340. t.pendown()
  341. t.circle(-8, 130)
  342. t.circle(-22, 100)
  343. t.circle(-8, 130)
  344. t.end_fill()
  345. #
  346. # 小嘴儿
  347. t.penup()
  348. t.goto(-15, 48)
  349. t.setheading(-36)
  350. t.begin_fill()
  351. t.pendown()
  352. t.circle(60, 70)
  353. t.setheading(-132)
  354. t.circle(-45, 100)
  355. t.end_fill()
  356. #
  357. # 右手爱心
  358. t.penup()

  359. #
  360. #
  361. # 标识
  362. # 文字具体位置需要微调
  363. #
  364. # 专属名
  365. t.pencolor("black")
  366. t.goto(-60, -140)
  367. t.write("Joy's Bing Dwen Dwen", font=('Arial', 10, 'bold italic'))
  368. #
  369. # 奥运时间地点
  370. t.pencolor('red')
  371. t.goto(-36, -160)
  372. t.write("BEIJING 2022", font=('Arial', 12, 'bold italic'))
  373. #
  374. # 奥运五环
  375. t.penup()
  376. t.goto(-5, -170)
  377. t.pendown()
  378. t.pencolor("blue")
  379. t.circle(6)
  380. t.penup()
  381. t.goto(10, -170)
  382. t.pendown()
  383. t.pencolor("black")
  384. t.circle(6)
  385. t.penup()
  386. t.goto(25, -170)
  387. t.pendown()
  388. t.pencolor("brown")
  389. t.circle(6)
  390. t.penup()
  391. t.goto(2, -175)
  392. t.pendown()
  393. t.pencolor("lightgoldenrod")
  394. t.circle(6)
  395. t.penup()
  396. t.goto(16, -175)
  397. t.pendown()
  398. t.pencolor("green")
  399. t.circle(6)
  400. t.penup()

  401. t.done()
复制代码

评分

参与人数 1荣誉 +5 鱼币 +5 贡献 +3 收起 理由
zy990106 + 5 + 5 + 3

查看全部评分

小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2022-2-19 18:42:45 | 显示全部楼层
每一步都注释的很详细,好评就是图片违规……
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-2-19 20:43:53 | 显示全部楼层

图片 违规 ?!

小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-2-19 20:50:51 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2022-2-20 08:26:00 | 显示全部楼层
厉害,好评
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-2-20 09:10:47 | 显示全部楼层
厉害
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2022-2-20 14:30:44 | 显示全部楼层
tomok 发表于 2022-2-19 20:43
图片 违规 ?!

可能东奥会有吉祥物版权吧2333
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-20 14:32:28 | 显示全部楼层
洋洋痒 发表于 2022-2-19 18:42
每一步都注释的很详细,好评就是图片违规……

可能东奥会有吉祥物版权吧2333
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-2-22 15:41:16 | 显示全部楼层
tomok 发表于 2022-2-19 20:43
图片 违规 ?!

可能是因为冰墩墩的版权问题?
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-2-23 11:46:39 | 显示全部楼层
还没试 先给个666
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-23 17:42:49 | 显示全部楼层
cywz 发表于 2022-2-22 15:41
可能是因为冰墩墩的版权问题?

yep~
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-24 07:52:01 | 显示全部楼层
smartsy 发表于 2022-2-23 11:46
还没试 先给个666

小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-2-26 22:54:47 | 显示全部楼层
不错哦,学习收藏了
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2022-2-26 23:19:11 | 显示全部楼层
厉害
收藏了
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-2-28 12:48:21 | 显示全部楼层

谢谢大佬!
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2024-9-13 18:48:46 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-6-8 04:13

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表