<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>จักรยาน Archives - KarnLab</title>
	<atom:link href="https://karnlab.com/tag/%e0%b8%88%e0%b8%b1%e0%b8%81%e0%b8%a3%e0%b8%a2%e0%b8%b2%e0%b8%99/feed/" rel="self" type="application/rss+xml" />
	<link>https://karnlab.com/tag/จักรยาน/</link>
	<description>Blog รีวิว หนังสือ เขียนโปรแกรม นานาสาระ</description>
	<lastBuildDate>Mon, 01 Oct 2018 12:03:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>

<image>
	<url>https://karnlab.com/wp-content/uploads/2017/12/Logo-150x150.png</url>
	<title>จักรยาน Archives - KarnLab</title>
	<link>https://karnlab.com/tag/จักรยาน/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>วาดรูปด้วยภาษาโลโก้ : ตอนที่ 17 – จักรยาน</title>
		<link>https://karnlab.com/logo-tutorial-ep17-bike/</link>
					<comments>https://karnlab.com/logo-tutorial-ep17-bike/#comments</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Mon, 01 Oct 2018 12:03:33 +0000</pubDate>
				<category><![CDATA[สอนเขียนโปรแกรม]]></category>
		<category><![CDATA[LOGO]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[จักรยาน]]></category>
		<category><![CDATA[ภาษาโลโก้]]></category>
		<category><![CDATA[วาดรูป]]></category>
		<category><![CDATA[เขียนโปรแกรม]]></category>
		<guid isPermaLink="false">http://karnlab.com/?p=1301</guid>

					<description><![CDATA[<p>สวัสดีครับ วันนี้เราจะมาวาดรูปจักรยาน ด้วยภาษาโลโก้กันครับ โดยในตอนนี้เราจะดูแบบที่ต้องการวาดก่อน แล้วค่อยๆ วาดรูปไปพร้อมๆ กันครับ โดยเราจะวาดรูปไปทีละองค์ประกอบ (component) จนสำเร็จเป็นรูปที่เราต้องการครับ คำสั่งที่น้องๆ จะเจอในบทนี้ คำสั่ง ความสามารถ ตัวอย่าง fd ระยะทาง bk ระยะทาง forward [&#8230;]</p>
<p>The post <a href="https://karnlab.com/logo-tutorial-ep17-bike/">วาดรูปด้วยภาษาโลโก้ : ตอนที่ 17 – จักรยาน</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>สวัสดีครับ วันนี้เราจะมาวาดรูปจักรยาน ด้วยภาษาโลโก้กันครับ โดยในตอนนี้เราจะดูแบบที่ต้องการวาดก่อน แล้วค่อยๆ วาดรูปไปพร้อมๆ กันครับ โดยเราจะวาดรูปไปทีละองค์ประกอบ (component) จนสำเร็จเป็นรูปที่เราต้องการครับ</p>
<p>คำสั่งที่น้องๆ จะเจอในบทนี้</p>
<table>
<tbody>
<tr>
<td width="198"><strong>คำสั่ง</strong></td>
<td width="227"><strong>ความสามารถ</strong></td>
<td width="227"><strong>ตัวอย่าง</strong></td>
</tr>
<tr>
<td width="198">fd ระยะทาง<br />
bk ระยะทาง</td>
<td width="227">forward = เดินหน้า<br />
backward = ถอยหลัง</td>
<td width="227">fd 100 = เดินหน้า 100 pixel<br />
bk 50 = ถอยหลัง 50 pixel</td>
</tr>
<tr>
<td width="198">rt องศา<br />
lt องศา</td>
<td width="227">right turn = หมุนขวา<br />
left turn = หมุนซ้าย</td>
<td width="227">rt 90 = หมุนไปทางขวา 90 องศา<br />
lt 45 = หมุนไปทางซ้าย 45 องศา</td>
</tr>
<tr>
<td width="198">repeat จำนวนครั้ง [ คำสั่ง ]</td>
<td width="227">repeat = ทำคำสั่งต่อไปนี้ ซ้ำ n ครั้ง</td>
<td width="227">repeat 3 [ fd 100 rt 120 ]<br />
repeat 4 [ fd 100 rt 90 ]<br />
repeat 6 [ fd 100 rt 60 ]</td>
</tr>
<tr>
<td width="198">TO ชื่อฟังก์ชัน :ตัวแปร<br />
คำสั่ง<br />
END</td>
<td width="227">function = สร้างชุดคำสั่ง</td>
<td width="227">TO square :size<br />
repeat 4 [ fd :size rt 90 ]<br />
END</td>
</tr>
<tr>
<td width="198">cs<br />
clean</td>
<td width="227">clear screen = ล้างหน้าจอ<br />
clean = ล้างหน้าจอ</td>
<td width="227"></td>
</tr>
<tr>
<td width="198">pu<br />
pd</td>
<td width="227">pen up = ยกปากกา<br />
pen down = วางปากกา</td>
<td width="227"></td>
</tr>
<tr>
<td width="198">ht<br />
st</td>
<td width="227">hide turtle = ซ่อนเต่าโลโก้<br />
show turtle = แสดงเต่าโลโก้</td>
<td width="227"></td>
</tr>
<tr>
<td width="198">setxy พิกัดx พิกัดy</td>
<td width="227">set (x,y) = กำหนดตำแหน่งเต่าโลโก้</td>
<td width="227">setxy 200 100</td>
</tr>
<tr>
<td width="198">setpensize ขนาด<br />
setpencolor รหัสสี<br />
fill<br />
setscreencolor รหัสสี</td>
<td width="227">set pen size = กำหนดขนาดปากกา<br />
set pen color = กำหนดสีปากกา<br />
fill = ระบายสี<br />
set screen color = กำหนดสีพื้นหลัง</td>
<td width="227">setpensize 5<br />
setpencolor 10<br />
fill<br />
setscreencolor 10</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>เราจะมาดูรูปต้นแบบที่เราจะวาดกันก่อนครับ ซึ่งก็คือจักรยานสี่น้ำเงินยี่ห้อหนึ่ง จะสังเกตได้ว่าจักรยานมีรายละเอียดเยอะพอสมควร แต่เราจะวาดเฉพาะส่วนที่สำคัญ ที่เมื่อใครๆ มาเห็นรูปของเราก็ต้องดูออกว่าเป็นจักรยานครับ</p>
<figure id="attachment_1265" aria-describedby="caption-attachment-1265" style="width: 1000px" class="wp-caption alignnone"><img fetchpriority="high" decoding="async" class="size-full wp-image-1265" src="https://karnlab.com/wp-content/uploads/2018/10/Bicycle-Prototype.jpg" alt="Bicycle Prototype" width="1000" height="597" /><figcaption id="caption-attachment-1265" class="wp-caption-text">Bicycle Prototype</figcaption></figure>
<p>รูปภาพจาก &#8211; <a href="https://www.mec.ca">https://www.mec.ca</a></p>
<p>&nbsp;</p>
<p>เรามาเริ่มเขียนโปรแกรมกันเลยครับ โดยตั้งค่าขนาดปากกา และกำหนดสีที่จะใช้กันก่อน</p>
<table>
<tbody>
<tr>
<td width="697">TO comment :message<br />
END</p>
<p>cs<br />
setpensize 5<br />
setpencolor &#8220;#303f9f</td>
</tr>
</tbody>
</table>
<p>(ฟังก์ชัน comment ไม่ได้ใช้วาดรูปอะไร แต่เป็น dummy function เพื่อให้เราสามารถเพิ่มคำอธิบายเข้าไปในโค้ดได้ครับ)</p>
<p>&nbsp;</p>
<p>วาดโครงจักรยาน (1)</p>
<table>
<tbody>
<tr>
<td width="697">comment &#8220;body_1<br />
rt 30 fd 100<br />
rt 60 fd 100<br />
rt 120 fd 100<br />
rt 60 fd 100</td>
</tr>
</tbody>
</table>
<figure id="attachment_1258" aria-describedby="caption-attachment-1258" style="width: 334px" class="wp-caption alignnone"><img decoding="async" class="size-full wp-image-1258" src="https://karnlab.com/wp-content/uploads/2018/10/LOGO-EP17-Bicycle-1.jpg" alt="LOGO EP17 - Bicycle 1" width="334" height="247" /><figcaption id="caption-attachment-1258" class="wp-caption-text">LOGO EP17 &#8211; Bicycle 1</figcaption></figure>
<p>&nbsp;</p>
<p>วาดโครงจักรยาน (2)</p>
<table>
<tbody>
<tr>
<td width="697">comment &#8220;body_2<br />
bk 100<br />
rt 60 fd 125<br />
lt 60 fd 25<br />
rt 90 fd 15<br />
rt 90 fd 50<br />
rt 90 fd 15<br />
rt 90 fd 25</td>
</tr>
</tbody>
</table>
<figure id="attachment_1259" aria-describedby="caption-attachment-1259" style="width: 325px" class="wp-caption alignnone"><img decoding="async" class="size-full wp-image-1259" src="https://karnlab.com/wp-content/uploads/2018/10/LOGO-EP17-Bicycle-2.jpg" alt="LOGO EP17 - Bicycle 2" width="325" height="258" /><figcaption id="caption-attachment-1259" class="wp-caption-text">LOGO EP17 &#8211; Bicycle 2</figcaption></figure>
<p>&nbsp;</p>
<p>วาดโครงจักรยาน (3)</p>
<table>
<tbody>
<tr>
<td width="697">comment &#8220;body_3<br />
rt 60 bk 125<br />
pu lt 60 bk 100 pd<br />
rt 60 fd 145<br />
arc 360 10</td>
</tr>
</tbody>
</table>
<figure id="attachment_1260" aria-describedby="caption-attachment-1260" style="width: 391px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1260" src="https://karnlab.com/wp-content/uploads/2018/10/LOGO-EP17-Bicycle-3.jpg" alt="LOGO EP17 - Bicycle 3" width="391" height="265" /><figcaption id="caption-attachment-1260" class="wp-caption-text">LOGO EP17 &#8211; Bicycle 3</figcaption></figure>
<p>&nbsp;</p>
<p>วาดล้อ (1)</p>
<table>
<tbody>
<tr>
<td width="697">comment &#8220;wheel_1<br />
bk 145<br />
setpencolor &#8220;#424242<br />
arc 360 50</td>
</tr>
</tbody>
</table>
<figure id="attachment_1261" aria-describedby="caption-attachment-1261" style="width: 376px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1261" src="https://karnlab.com/wp-content/uploads/2018/10/LOGO-EP17-Bicycle-4.jpg" alt="LOGO EP17 - Bicycle 4" width="376" height="277" /><figcaption id="caption-attachment-1261" class="wp-caption-text">LOGO EP17 &#8211; Bicycle 4</figcaption></figure>
<p>&nbsp;</p>
<p>วาดล้อ (2)</p>
<table>
<tbody>
<tr>
<td width="697">comment &#8220;wheel_2<br />
pu lt 60 fd 200 pd<br />
arc 360 50</td>
</tr>
</tbody>
</table>
<figure id="attachment_1262" aria-describedby="caption-attachment-1262" style="width: 403px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1262" src="https://karnlab.com/wp-content/uploads/2018/10/LOGO-EP17-Bicycle-5.jpg" alt="LOGO EP17 - Bicycle 5" width="403" height="274" /><figcaption id="caption-attachment-1262" class="wp-caption-text">LOGO EP17 &#8211; Bicycle 5</figcaption></figure>
<p>&nbsp;</p>
<p>วาดเกียร์</p>
<table>
<tbody>
<tr>
<td width="697">comment &#8220;wheel_3<br />
bk 100<br />
arc 360 25</td>
</tr>
</tbody>
</table>
<figure id="attachment_1263" aria-describedby="caption-attachment-1263" style="width: 397px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full wp-image-1263" src="https://karnlab.com/wp-content/uploads/2018/10/LOGO-EP17-Bicycle-6.jpg" alt="LOGO EP17 - Bicycle 6" width="397" height="263" /><figcaption id="caption-attachment-1263" class="wp-caption-text">LOGO EP17 &#8211; Bicycle 6</figcaption></figure>
<p>&nbsp;</p>
<p>เสร็จแล้วครับ รูปจักรยาน ถ้าเราลองลดความซับซ้อนของรูปภาพ แล้ววาดแค่ส่วนสำคัญของภาพ เราก็จะได้รูปภาพที่เราต้องการเร็วขึ้นครับ (render เร็วขึ้น)</p>
<p>Code ทั้งหมด สามารถเข้าไปดูได้ที่นี่ครับ <a href="https://github.com/doctorkarn/logo-lang/blob/master/EP17.txt">https://github.com/doctorkarn/logo-lang/blob/master/EP17.txt</a></p>
<p>สามารถติดตาม “วาดรูปด้วยภาษาโลโก้” ตอนอื่นๆ ได้ที่นี่ครับ <a href="https://karnlab.com/tag/ภาษาโลโก้">https://karnlab.com/tag/ภาษาโลโก้</a></p>
<p>&nbsp;</p>
<p>The post <a href="https://karnlab.com/logo-tutorial-ep17-bike/">วาดรูปด้วยภาษาโลโก้ : ตอนที่ 17 – จักรยาน</a> appeared first on <a href="https://karnlab.com">KarnLab</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://karnlab.com/logo-tutorial-ep17-bike/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: karnlab.com @ 2026-08-26 05:58:34 by W3 Total Cache
-->