tag:blogger.com,1999:blog-65555130588074533822024-03-05T13:59:27.285-08:00DK's BlogUnknownnoreply@blogger.comBlogger90125tag:blogger.com,1999:blog-6555513058807453382.post-44564260748152254172013-01-02T23:01:00.002-08:002013-01-02T23:03:41.633-08:00[Arduino] Serial port的困惑解<b>Serial Port :</b><br />
<b style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">串列埠</b><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">(Serial port)又稱「</span><b style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">串列埠</b><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">」,主要用於</span><a class="mw-redirect" href="http://zh.wikipedia.org/wiki/%E4%B8%B2%E8%A1%8C" style="background-color: white; background-image: none; color: #0b0080; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px; text-decoration: initial;" title="序列">序列</a><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">式逐</span><a href="http://zh.wikipedia.org/wiki/%E4%BD%8D%E5%85%83" style="background-color: white; background-image: none; color: #0b0080; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px; text-decoration: initial;" title="位元">位</a><a href="http://zh.wikipedia.org/wiki/%E6%95%B0%E6%8D%AE" style="background-color: white; background-image: none; color: #0b0080; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px; text-decoration: initial;" title="資料">資料</a><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">傳輸。常見的有一般</span><a class="mw-redirect" href="http://zh.wikipedia.org/wiki/%E9%9B%BB%E8%85%A6" style="background-color: white; background-image: none; color: #0b0080; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px; text-decoration: initial;" title="電腦">電腦</a><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">應用的</span><a href="http://zh.wikipedia.org/wiki/RS-232" style="background-color: white; background-image: none; color: #0b0080; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px; text-decoration: initial;" title="RS-232">RS-232</a><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">(使用 25 針或 9 針連結器)和</span><a href="http://zh.wikipedia.org/wiki/%E5%B7%A5%E6%A5%AD%E9%9B%BB%E8%85%A6" style="background-color: white; background-image: none; color: #0b0080; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px; text-decoration: initial;" title="工業電腦">工業電腦</a><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">應用的</span><a class="mw-redirect" href="http://zh.wikipedia.org/wiki/%E5%8D%8A%E9%9B%99%E5%B7%A5" style="background-color: white; background-image: none; color: #0b0080; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px; text-decoration: initial;" title="半雙工">半雙工</a><a class="mw-redirect" href="http://zh.wikipedia.org/wiki/RS-485" style="background-color: white; background-image: none; color: #0b0080; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px; text-decoration: initial;" title="RS-485">RS-485</a><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">與</span><a class="mw-redirect" href="http://zh.wikipedia.org/wiki/%E5%85%A8%E9%9B%99%E5%B7%A5" style="background-color: white; background-image: none; color: #0b0080; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px; text-decoration: initial;" title="全雙工">全雙工</a><a class="mw-redirect" href="http://zh.wikipedia.org/wiki/RS-422" style="background-color: white; background-image: none; color: #0b0080; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px; text-decoration: initial;" title="RS-422">RS-422</a><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">。</span><br />
<span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">(轉自維基百科: </span><span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">http://zh.wikipedia.org/wiki/%E4%B8%B2%E5%8F%A3)</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;"><br /></span></span>
<b><span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">Serial.begin</span></span><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">(Baud Rate): </span></b><br />
<span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">Baud Rate</span><span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">指從一裝置發到另一裝置的位元率,即<span style="color: red;">每秒鐘多少位元bits per second (bit/s)</span>。典型的鮑率是300, 1200, 2400, 9600, 115200, 19200等bit/s。<b>一般通訊兩端裝置都要設為相同的鮑率</b>,但有些裝置也可以設定為自動檢測鮑率。</span><br />
<span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">(轉自維基百科: </span><span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">http://zh.wikipedia.org/wiki/RS232)</span></span><br />
<br />
<br />
<span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;"><b>Baud Rate的速度要設多少:</b></span><br />
<span style="background-color: white; font-family: sans-serif; font-size: 15px; line-height: 22.066667556762695px;">取決於設備雙方的UART晶片接受的範圍,</span><span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">一般建議最高設到 115200</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;"><br /></span></span>
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">為什麼arduino都用Serial.begin(9600):</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">arduino範例這麼寫,也可使用別的baud rate,只要Serial.print使用相同baud rate即可</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;"><br /></span></span>
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">計算傳輸的速度:</span></span><br />
9600 bps , bit per second<br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">data byte 是 8-bit</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">傳輸的時候,一般用 n, 8, 1, 即 n parity bit, 8 data bits, 1 stop bit</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">所以一個 byte 傳輸時,實際是 1 start bit + 8 data bits + 1 stop bit = 10 bits</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;"><br /></span></span>
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">9600 / 10 = 960 bytes,一秒鐘可以傳 960 bytes</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;"><br /></span></span>
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;"><b>Arduino並不是真正的Serial Port 傳輸:</b></span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">arduino 的COM port是透過板子上的 晶片模擬的</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">其實 Arduino 上有一顆晶片就是 USB to Serail converter</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">比如 Duemilanove 的 FT232r,或是 UNO 的 atmega16u2</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">所以真正 PC 的 COM Port 速度限制還要查 USB to Serial 晶片的 datasheet</span></span><br />
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;"><br /></span></span>
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;"><br /></span></span>
<span style="font-family: sans-serif;"><span style="font-size: 15px; line-height: 22.066667556762695px;">解答感謝<a href="http://coopermaa2nd.blogspot.tw/" target="_blank">Cooper Maa</a></span></span>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-6555513058807453382.post-80903270746706978972012-11-02T01:20:00.001-07:002012-11-02T01:20:20.296-07:00[Artwork] 有事嗎 Don't Bother Me<iframe allowfullscreen="allowfullscreen" frameborder="0" height="281" mozallowfullscreen="mozallowfullscreen" src="http://player.vimeo.com/video/52671181?badge=0" webkitallowfullscreen="webkitallowfullscreen" width="500"></iframe> <br />
<a href="http://vimeo.com/52671181">有事嗎? / Don't Bother Me 2012</a> from <a href="http://vimeo.com/user9702221">Eva Chang</a> on <a href="http://vimeo.com/">Vimeo</a>.<br />
名稱: 有事嗎?<br /> 材質: 複合媒材<br /> 年份: 2012<br /> <br /> 群體社會中,人們的行為與生活的種種,常會遇到他人對自己有著不同的評論與想法,意見來自的管道多元,小至家庭、朋友、同事,大至不相識的網路群眾。撇開評論好與壞,傳達形式,都容易讓人產生壓迫感,像是噪音,於腦海,揮,之,不,去。作品想傳達外界聲音已讓人產生煩躁感,一舉一動都得面對他人的檢視,即便聲音靜止,評論仍竄流於空間,跟隨自己。Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-72811016998018881422012-09-01T17:25:00.005-07:002012-09-01T17:25:41.687-07:00[oF] Workshop 讀取圖片練習以下內容使用範例可至of_v0071_win_cb_release\examples\graphics\imageLoaderExample查看<br />
<br />
<br />
<br />
<div class="MsoNormal">
<span lang="EN-US">Graphic</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">範例練習</span><span lang="EN-US"><o:p></o:p></span></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<br /></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<b><u><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">依照滑鼠大小改變圖片尺寸</span><span lang="EN-US"><o:p></o:p></span></u></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 24.0pt; mso-list: l1 level1 lfo2; mso-para-margin-left: 0gd; text-indent: -24.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">l<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><b><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">撰寫</span><span lang="EN-US">OF</span></b><b><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">程式碼</span><span lang="EN-US"><o:p></o:p></span></b></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l2 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟</span><span lang="EN-US">empty</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">資料夾</span><span lang="EN-US">(of_v0071_win_cb_release\examples\empty)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l2 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在</span><span lang="EN-US">app</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">資料夾下新增一個資料夾,名稱自訂</span><span lang="EN-US">(of_v0071_win_cb_release\apps)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l2 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">複製</span><span lang="EN-US">emptyExample</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">資料夾到新增的資料夾中</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l2 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">4.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟資料夾中的</span><span lang="EN-US">emptyExample.cbp<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l2 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">5.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">執行且編譯</span><span lang="EN-US">(F9)<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 24.0pt; mso-list: l1 level1 lfo2; mso-para-margin-left: 0gd; text-indent: -24.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">l<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">從原始範例複製需要的圖片</span><i><span lang="EN-US">(of_v0071_win_cb_release\examples\graphics\imageLoaderExample\bin\data)<o:p></o:p></span></i></div>
<div class="MsoListParagraph" style="margin-left: 24.0pt; mso-para-margin-left: 0gd;">
<span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">到</span><span lang="EN-US">emptyExample</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的</span><span lang="EN-US">data</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">資料夾底下</span><span lang="EN-US">(emptyExample\bin\data)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 24.0pt; mso-para-margin-left: 0gd;">
<b><i><span style="color: red; font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">若檔案沒有編譯過,不會產生</span><span lang="EN-US" style="color: red;">bin</span></i></b><b><i><span style="color: red; font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">與</span><span lang="EN-US" style="color: red;">data</span></i></b><b><i><span style="color: red; font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">資料夾</span><span lang="EN-US" style="color: red;"><o:p></o:p></span></i></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 24.0pt; mso-list: l1 level1 lfo2; mso-para-margin-left: 0gd; text-indent: -24.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">l<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟</span><span lang="EN-US">testApp.h<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l5 level1 lfo3; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">定義一個變數,型態為</span><span lang="EN-US">ofImage</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,名稱為</span><span lang="EN-US">bikers<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBH0pu98JRjYSdRBe4oWRv7nvtwfXfZkQxmWrDfLecKKwtdvkZ02Mwg6cQlAcuZ3IAeI1uei0AEZarw0fnYX6-V5ZexRexkSYXsDkqzN5qd9gsJE8IsD35rwZsQx0hx5ubLoQkK4P1A0U/s1600/a0.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBH0pu98JRjYSdRBe4oWRv7nvtwfXfZkQxmWrDfLecKKwtdvkZ02Mwg6cQlAcuZ3IAeI1uei0AEZarw0fnYX6-V5ZexRexkSYXsDkqzN5qd9gsJE8IsD35rwZsQx0hx5ubLoQkK4P1A0U/s1600/a0.JPG" /></a></div>
<br />
<div class="MsoListParagraph" style="margin-left: 24.0pt; mso-list: l1 level1 lfo2; mso-para-margin-left: 0gd; text-indent: -24.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">l<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟</span><span lang="EN-US">testApp.cpp</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,在</span><span lang="EN-US">setup</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中寫入初始設定</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l4 level1 lfo4; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">設定背景色為白色</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">ofBackground(255,255,255);<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l4 level1 lfo4; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在</span><span lang="EN-US">bikers</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中讀取一張圖片</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">bikers.loadImage("images/bikers.jpg");<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinrnAnd3AGxvW01BbpD5ZG-RtVo14CRguwRaHnaySMer9MAZHxyEVLSpdnvuWZ33lmcm-5tMpQ-GltuoHLXlfVusimsNIa9fRJPrXmZbdEeJ_53xwOJbeaSDsAPr-NqsZQFZ3Nz1k8AI0/s1600/a01.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinrnAnd3AGxvW01BbpD5ZG-RtVo14CRguwRaHnaySMer9MAZHxyEVLSpdnvuWZ33lmcm-5tMpQ-GltuoHLXlfVusimsNIa9fRJPrXmZbdEeJ_53xwOJbeaSDsAPr-NqsZQFZ3Nz1k8AI0/s1600/a01.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l4 level1 lfo4; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">若圖片名稱錯誤會出現</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieRpLE2GbhLnrxZ2DeDO_NBiqIVjmSs4FkijE9FX5OcVcd6uHzB0NidiUXDQfCjjbefqzKe-Ui4GXaePHVeF1Kdbxu_R3i_pjV7QZsHrTaqM5M-7ZTtDj5tdsKdi9iLohQcnuzcUOhyrA/s1600/a1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieRpLE2GbhLnrxZ2DeDO_NBiqIVjmSs4FkijE9FX5OcVcd6uHzB0NidiUXDQfCjjbefqzKe-Ui4GXaePHVeF1Kdbxu_R3i_pjV7QZsHrTaqM5M-7ZTtDj5tdsKdi9iLohQcnuzcUOhyrA/s1600/a1.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l4 level1 lfo4; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">4.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">讀取後要顯示圖片,在</span><span lang="EN-US">draw</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中打入</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">bikers.draw(0,0,mouseX,mouseY);<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl1xGU7lV7WJI1lYEugjMmSx1FlHzLY0VnH7TGC-jzNDtxbHF4y6Vz2SmDMfczCB11nJCb8aPLe8_QC9OrXQToXWJ1hXLMFZ444HNWgOwiml4RN7Kq-sRbNw9qEEKLrrLcPLrNyca2z88/s1600/a2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl1xGU7lV7WJI1lYEugjMmSx1FlHzLY0VnH7TGC-jzNDtxbHF4y6Vz2SmDMfczCB11nJCb8aPLe8_QC9OrXQToXWJ1hXLMFZ444HNWgOwiml4RN7Kq-sRbNw9qEEKLrrLcPLrNyca2z88/s1600/a2.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l4 level1 lfo4; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">5.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">若要更改色調,使用</span><span lang="EN-US">ofSetColor(R,G,B)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">ofSetColor(255,0,0);<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn6V8r4hVdRsh5tScgK5g_vH4UMtugX7EAexb8BCBoKr0cM9zjkpC8TlatlWJoN4p47OL9U04cSRY1MWg1GQXJjV31rhAPoDZLDjz_RYUjCXoVZX5TU9I1JI6fBkiPzqwJcURVTC6WpfQ/s1600/a3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn6V8r4hVdRsh5tScgK5g_vH4UMtugX7EAexb8BCBoKr0cM9zjkpC8TlatlWJoN4p47OL9U04cSRY1MWg1GQXJjV31rhAPoDZLDjz_RYUjCXoVZX5TU9I1JI6fBkiPzqwJcURVTC6WpfQ/s1600/a3.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<span lang="EN-US" style="font-family: "Calibri","sans-serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;"><br clear="all" style="mso-special-character: line-break; page-break-before: always;" />
</span>
<div class="MsoNormal">
<br /></div>
<div align="center" class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd; text-align: center;">
<b><u><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">讀取圖片練習二</span><span lang="EN-US"><o:p></o:p></span></u></b></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l3 level1 lfo5; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在</span><span lang="EN-US">testApp.h</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">定義</span><span lang="EN-US">ofImage</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">變數,名稱為</span><span lang="EN-US">gear<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">ofImage gear;<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnMhrqm23sy75odz_mEGLC4U__5PVcEEBY9o-WURN99UHgGptIDDpyWj6UNESmvOzgd7pQarM9nVR6cF5mmJ7BXNzZAfD-etMFA6FephIlc8euC0TCyE3ErrHJ0VoqRA4vX9e_CDDATiY/s1600/a4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnMhrqm23sy75odz_mEGLC4U__5PVcEEBY9o-WURN99UHgGptIDDpyWj6UNESmvOzgd7pQarM9nVR6cF5mmJ7BXNzZAfD-etMFA6FephIlc8euC0TCyE3ErrHJ0VoqRA4vX9e_CDDATiY/s1600/a4.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 24.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 24.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l3 level1 lfo5; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">讀取圖片,在</span><span lang="EN-US">setup</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中寫入</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">gear.loadImage("images/gears.gif");<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l3 level1 lfo5; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">顯示圖片,在</span><span lang="EN-US">draw</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中寫入程式,並把先前的滑鼠控制註解掉</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">bikers.draw(0,0,bikers.getWidth()/2,bikers.getHeight()/2);
<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">//</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">擺放圖片在</span><span lang="EN-US">0,0</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的位置,長寬為自己的一半</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">gear.resize(bikers.getWidth()/2,bikers.getHeight()/2);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US"> //</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">將</span><span lang="EN-US">gear</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的尺寸縮放跟</span><span lang="EN-US">biker</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">一樣</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">gear.draw(bikers.getWidth()/2,0);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt; tab-stops: center 219.65pt;">
<span lang="EN-US"> //</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">擺放圖片在</span><span lang="EN-US">bike</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">旁,</span><span lang="EN-US">y</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">為</span><span lang="EN-US">0 <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l3 level1 lfo5; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">4.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">若要使圖片有透明度,讀取的圖片需為具透明屬性的圖片,</span><span lang="EN-US">ex.png<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">讀取有透明度圖片</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo6; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在</span><span lang="EN-US">testApp.h</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中定義</span><span lang="EN-US">ofImage</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">型態的變數</span><span lang="EN-US">transparency<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">ofImage transparency;<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjrZ-QDk6epsLTxQO2DDx8Km_O5eo3g_d9BtRduuae2WFKDHIhgcRlGRrlIr1H26FB4YePQAzU8mKBU0Fp78LmyBB4CzbxeVlv9xl7sh-qXt0w7OLQOWxCtMhFm-hhj4K9q9f1pRkxnDs/s1600/b1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjrZ-QDk6epsLTxQO2DDx8Km_O5eo3g_d9BtRduuae2WFKDHIhgcRlGRrlIr1H26FB4YePQAzU8mKBU0Fp78LmyBB4CzbxeVlv9xl7sh-qXt0w7OLQOWxCtMhFm-hhj4K9q9f1pRkxnDs/s1600/b1.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo6; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在</span><span lang="EN-US">testApp.cpp</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中的</span><span lang="EN-US">setup</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">將含有透明圖層的圖片讀取至</span><span lang="EN-US">transparency<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">transparency.loadImage("images/transparency.png");<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl2_W9BCtJtdZhdnXbXrlYOvvuchJ0rqeqYcViTcv6jDcngFda288w0ZIyOnhf0eX4OG_UOuMgOfnhbQ-eTPnGUsaXUsY_J-KN-o8L94rXkoWKce8MBKPWec-HfnxgKrxGVmKfEvavGyg/s1600/b2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl2_W9BCtJtdZhdnXbXrlYOvvuchJ0rqeqYcViTcv6jDcngFda288w0ZIyOnhf0eX4OG_UOuMgOfnhbQ-eTPnGUsaXUsY_J-KN-o8L94rXkoWKce8MBKPWec-HfnxgKrxGVmKfEvavGyg/s1600/b2.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo6; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在</span><span lang="EN-US">draw</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中,顯示</span><span lang="EN-US">transparency</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,因含透明度,需使用</span><span lang="EN-US">ofEnableAlphaBlending()</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">與</span><span lang="EN-US">ofDisableAlpahBlending()<o:p></o:p></span></div>
<div class="MsoListParagraph">
<span lang="EN-US">ofEnableAlphaBlending();</span><span lang="EN-US" style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt;"> //</span><span style="font-family: "新細明體","serif"; font-size: 8.0pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟透明圖層效果</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph">
<span lang="EN-US">float wave =
sin(ofGetElapsedTimef());</span><span lang="EN-US" style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt;"> //</span><span style="font-family: "新細明體","serif"; font-size: 8.0pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">定義一個變數</span><span lang="EN-US" style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt;">wave</span><span style="font-family: "新細明體","serif"; font-size: 8.0pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,使用</span><span lang="EN-US" style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt;">sin</span><span style="font-family: "新細明體","serif"; font-size: 8.0pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">函數,</span><span lang="EN-US" style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt;">ofGetElapsedTimef</span><span style="font-family: "新細明體","serif"; font-size: 8.0pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">取得程式執行經過時間</span><span lang="EN-US" style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt;">(</span><span style="font-family: "新細明體","serif"; font-size: 8.0pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">浮點數</span><span lang="EN-US" style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt;">)</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph">
<span lang="EN-US">transparency.draw(mouseX+(wave*100),mouseY);</span><span lang="EN-US" style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt;">//transparaency</span><span style="font-family: "新細明體","serif"; font-size: 8.0pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">這圖將會跟著滑鼠座標,且做左右幅度為</span><span lang="EN-US" style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt;">100</span><span style="font-family: "新細明體","serif"; font-size: 8.0pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的來回震盪</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<span lang="EN-US"> ofDisableAlphaBlending(); </span><span lang="EN-US" style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt;">//</span><span style="font-family: "新細明體","serif"; font-size: 8.0pt; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-size: 11.0pt; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">關閉透明圖層效果</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQH1vsnIsi_PkV1RG-McoCDMHsZOmzg13NEYDBPON25hr7rWYDnIkGmcKzctMuaphUY6rtHNJ2EdFxiZxToy22Fthj6PBG9PGoFLCjNh5yV4YLHgXCq46vhP4KQQgLPoANuNwJE0h6yIc/s1600/b3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQH1vsnIsi_PkV1RG-McoCDMHsZOmzg13NEYDBPON25hr7rWYDnIkGmcKzctMuaphUY6rtHNJ2EdFxiZxToy22Fthj6PBG9PGoFLCjNh5yV4YLHgXCq46vhP4KQQgLPoANuNwJE0h6yIc/s1600/b3.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-78037556197653152472012-08-31T23:25:00.006-07:002012-08-31T23:25:48.402-07:00[oF] Workshop範例練習<br />
<div class="MsoNormal">
</div>
<div class="MsoNormal">
<b><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">撰寫</span><span lang="EN-US">OF</span></b><b><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">程式碼</span><span lang="EN-US"><o:p></o:p></span></b></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟</span><span lang="EN-US">empty</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">資料夾</span><span lang="EN-US">(of_v0071_win_cb_release\examples\empty)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在</span><span lang="EN-US">app</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">資料夾下新增一個資料夾,名稱自訂</span><span lang="EN-US">(of_v0071_win_cb_release\apps)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">複製</span><span lang="EN-US">emptyExample</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">資料夾到新增的資料夾中</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">4.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟資料夾中的</span><span lang="EN-US">emptyExample.cbp<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">使用滑鼠控制圓形解析度</span><span lang="EN-US"><o:p></o:p></span></b></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l1 level1 lfo2; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟</span><span lang="EN-US">main.cpp</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,可更改視窗大小</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">ofSetupOpenGL(&window, 1024, 768, OF_WINDOW)<o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">1024</span></i><i><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">為視窗寬、</span><span lang="EN-US">768</span></i><i><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">為視窗高</span><span lang="EN-US"><o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l1 level1 lfo2; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟</span><span lang="EN-US">testApp.cpp<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l1 level1 lfo2; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">可看到</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">void testApp::setup(){<o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">//</span></i><i><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">初始設定值</span><span lang="EN-US"><o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">}<o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">//--------------------------------------------------------------<o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">void testApp::update(){<o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">//</span></i><i><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">資料更新</span><span lang="EN-US"><o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">}<o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">//--------------------------------------------------------------<o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">void testApp::draw(){<o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">//</span></i><i><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">繪製圖形</span><span lang="EN-US"><o:p></o:p></span></i></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<i><span lang="EN-US">}<o:p></o:p></span></i></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicw5UqHkGxxl3oAzVHA4P66G_4AmaG4js6nFFvRVzO3pHcexsv1s3WZEFP_tFIx1-QBXcC40V549TgORUaxBDtaxxdWCdQRODet7EUXfL_Lm_Q_MKCq_h0VfBWK0NwV2U9J5sz1FVeSIQ/s1600/2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicw5UqHkGxxl3oAzVHA4P66G_4AmaG4js6nFFvRVzO3pHcexsv1s3WZEFP_tFIx1-QBXcC40V549TgORUaxBDtaxxdWCdQRODet7EUXfL_Lm_Q_MKCq_h0VfBWK0NwV2U9J5sz1FVeSIQ/s1600/2.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l1 level1 lfo2; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">4.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">撰寫程式碼</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">setup</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">函式中只會在開啟程式時執行一次,</span><span lang="EN-US">update</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">與</span><span lang="EN-US">draw</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">則是依照</span><span lang="EN-US">ofSetFrameRate</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的設定不斷執行函式中的程式</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">void
testApp::setup(){<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US"> ofBackground(0,0,0); //</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">設定背景色為黑色</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US"> ofSetFrameRate(30); //</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">每秒更新速度為三十次一秒</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">//--------------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">void
testApp::update(){<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US"> ofSetCircleResolution(mouseX/32); //</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">設定圓的邊數為滑鼠座標</span><span lang="EN-US">/32<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">//--------------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">void
testApp::draw(){<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US"> ofColor(255,0,0); //</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">設定顏色為紅色</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US"> ofCircle(300,300,50,50); //</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">畫一個圓,位置在</span><span lang="EN-US">300,300</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,直徑</span><span lang="EN-US">30<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US"> string s = "resolution =
"+ofToString(mouseX/32,3);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US"> //</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">定義一變數</span><span lang="EN-US">s</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,型態為字串,</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US"> //ofToString</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">函式將</span><span lang="EN-US">mouseX/32</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的數值轉換為字串,</span><span lang="EN-US">3</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">為可顯示最大位數</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US"> ofDrawBitmapString(s,mouseX,mouseY); //</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">顯示字串</span><span lang="EN-US">s</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,位置在</span><span lang="EN-US">mouseX,mouseY<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<span lang="EN-US">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDjhvs4_3UHCRkGo_igXF_ep1ESlM5Q9JTW_e4yrT2zVOhPnVz_ZDOrWY-Wk97yI9AS1CORMHOz7ivNXvPLV39rlAy8N9M_o3O2ORgWjmdKFbzaUqQ80nmke44ny_yuktHEBWyzT0KVGM/s1600/4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDjhvs4_3UHCRkGo_igXF_ep1ESlM5Q9JTW_e4yrT2zVOhPnVz_ZDOrWY-Wk97yI9AS1CORMHOz7ivNXvPLV39rlAy8N9M_o3O2ORgWjmdKFbzaUqQ80nmke44ny_yuktHEBWyzT0KVGM/s1600/4.JPG" /></a></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
</div>
<div class="MsoNormal" style="margin-left: 24.0pt;">
<br /></div>
<div class="MsoNormal">
<b><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">讓圓的解析度不斷累加,大於一百遍從頭</span><span lang="EN-US"><o:p></o:p></span></b></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟</span><span lang="EN-US">testApp.h</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,此檔案宣告各種全域變數</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnM280M4PerJl2bVgOozsLdEoemjUvSBpWQjDtS7fT6aLMdBda8CfUK9gT3sZl62m8g6ZmUCZ6XWegXOd_Q21MHoK8wYZ7ybiG2rAfTIWwLUmhOhqZpSrX8PmZn73pg4C58t4EVLu9T3o/s1600/5.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnM280M4PerJl2bVgOozsLdEoemjUvSBpWQjDtS7fT6aLMdBda8CfUK9gT3sZl62m8g6ZmUCZ6XWegXOd_Q21MHoK8wYZ7ybiG2rAfTIWwLUmhOhqZpSrX8PmZn73pg4C58t4EVLu9T3o/s1600/5.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 1.5gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">定義變數</span><span lang="EN-US">r</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,型態為整數</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 1.5gd;">
<span lang="EN-US">int r;<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPJphM83trVaairunPx2KRnJccQ2feiSwX18OKdkndmZqujlrBNf-WS-gz9Xy2ilUg47ED9aLjTsEcpIPL0_pyYrvRaxHkkY_bYU56k8szFxQow06fuJIXobEGHewWRrnXu0ffRx5skZg/s1600/6.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPJphM83trVaairunPx2KRnJccQ2feiSwX18OKdkndmZqujlrBNf-WS-gz9Xy2ilUg47ED9aLjTsEcpIPL0_pyYrvRaxHkkY_bYU56k8szFxQow06fuJIXobEGHewWRrnXu0ffRx5skZg/s1600/6.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 1.5gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 1.5gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">回到</span><span lang="EN-US">testApp.cpp</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">底下的</span><span lang="EN-US">setup</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">給定初始值</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 1.5gd;">
<span lang="EN-US">r=0;<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiHoQjPdNJLSPvXZwT59DyVMGFf00CAcs67N_GJXkt4NoZc2lGIOnFzaxJh5_kJB1vW-WQ8axAPlyrnZqQ5TfKB4JFV1_YcsoxNyUEWLwcdetROIoVkRvyQVrHFSVaslLe1KPdD6oZT_Y/s1600/7.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiHoQjPdNJLSPvXZwT59DyVMGFf00CAcs67N_GJXkt4NoZc2lGIOnFzaxJh5_kJB1vW-WQ8axAPlyrnZqQ5TfKB4JFV1_YcsoxNyUEWLwcdetROIoVkRvyQVrHFSVaslLe1KPdD6oZT_Y/s1600/7.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 1.5gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -21.3pt;">
<!--[if !supportLists]--><span lang="EN-US">4.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">在</span><span lang="EN-US">update</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中寫入,並且把</span><span lang="EN-US">ofSetCircleResolution(mouseX/32)</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">改成</span><span lang="EN-US">ofSetCircleResolution(r)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">r=r+1;<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">if(r>100<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-para-margin-left: 0gd;">
<span lang="EN-US"> r=0;<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">}<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN7bcNZ4CA0rUvbrX-cbypwyXe80V2uS1WslREvZyT9fscvDw1O1DNECJpw8I6z5qmXLSJeu7eJtVgtMbF_K0p-aBwq3vAE7nouTucgez-7U_-xhVbQJeeOHVKVFKigimWCKAGVoBAG6k/s1600/n1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN7bcNZ4CA0rUvbrX-cbypwyXe80V2uS1WslREvZyT9fscvDw1O1DNECJpw8I6z5qmXLSJeu7eJtVgtMbF_K0p-aBwq3vAE7nouTucgez-7U_-xhVbQJeeOHVKVFKigimWCKAGVoBAG6k/s1600/n1.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-list: l0 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -21.3pt;">
<!--[if !supportLists]--><span lang="EN-US">5.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">讓畫面顯示的數值也為</span><span lang="EN-US">r</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">,改寫</span><span lang="EN-US">draw</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">中</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">string s = "resolution = "+ofToString(mouseX/32,3);<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-para-margin-left: 0gd;">
<span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">改寫為</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-para-margin-left: 0gd;">
<span lang="EN-US">string s = "resolution = "+ofToString(r);<o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEire1XMSM_nlL3BhHRxIcS2QbRRdrZbZdINItwhD6625wzLd6KLQsm7_AjKxLF8xY3LWgTMAmcYNAbarkfFBxw4gmvtZcflC6E77iJ4ipzqYc1hFMUO7f2gKGBRwMkwVZ9F_1r8QN03fDY/s1600/n2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEire1XMSM_nlL3BhHRxIcS2QbRRdrZbZdINItwhD6625wzLd6KLQsm7_AjKxLF8xY3LWgTMAmcYNAbarkfFBxw4gmvtZcflC6E77iJ4ipzqYc1hFMUO7f2gKGBRwMkwVZ9F_1r8QN03fDY/s1600/n2.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 21.3pt; mso-para-margin-left: 0gd;">
<br /></div>
<br />
<br />
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-43825375018360705862012-08-31T21:57:00.003-07:002012-08-31T21:57:50.913-07:00[oF] 新版0071<br />
<div class="MsoNormal">
<span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">下載</span><span lang="EN-US">Openframework<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l2 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">前往</span><span lang="EN-US">Openframework</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">官方網站</span><span lang="EN-US">(<a href="http://www.openframeworks.cc/download/">http://www.openframeworks.cc/download/</a>)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l2 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">下載並安裝</span><span lang="EN-US">CodeBlocks(<a href="http://www.codeblocks.org/downloads/26">http://www.codeblocks.org/downloads/26</a>)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l2 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">下載</span><span lang="EN-US">OF Lirbray<br />
(<a href="http://www.openframeworks.cc/versions/v0.071/of_v0071_win_cb_release.zip">http://www.openframeworks.cc/versions/v0.071/of_v0071_win_cb_release.zip</a>)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv088-QfohTNE1IF0MouqgNMPQzlY7otryRBvowbzq1bDHqWpYuYXnBN1k7lD1I-R3jVNwUKtlf0Q_4IfExBysU7PLUZKURw12j1fkDj-yhOhKPLkeN0xEBWWpil6YdftEy027q2LOZDI/s1600/install.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv088-QfohTNE1IF0MouqgNMPQzlY7otryRBvowbzq1bDHqWpYuYXnBN1k7lD1I-R3jVNwUKtlf0Q_4IfExBysU7PLUZKURw12j1fkDj-yhOhKPLkeN0xEBWWpil6YdftEy027q2LOZDI/s1600/install.JPG" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l2 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">4.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">下載連結檔案</span><span lang="EN-US"><a href="http://www.openframeworks.cc/content/files/codeblocks_additions.zip"><span style="background: white; color: #ee3987; font-family: "Arial","sans-serif"; font-size: 10.0pt;">additions for codeblocks to work with OF</span></a><br />
(<a href="http://www.openframeworks.cc/content/files/codeblocks_additions.zip">http://www.openframeworks.cc/content/files/codeblocks_additions.zip</a>)<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l2 level1 lfo1; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">5.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">解壓縮檔內有兩個資料夾,分別把資料夾中的檔案複製到</span><span lang="EN-US">cb</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">的資料夾中</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 48.0pt; mso-list: l1 level2 lfo2; mso-para-margin-left: 0gd; text-indent: -24.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><strong><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 10pt;">add_to_codeblocks_mingw_include </span></strong><strong><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 新細明體, serif; font-size: 10pt;">內容複製到</span></strong><strong><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 新細明體, serif; font-size: 10pt; font-weight: normal;">→</span></strong><strong><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 10pt; font-weight: normal;"><br />
</span></strong><span class="apple-converted-space"><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 10pt;"> </span></span><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 10pt;">"</span><strong><span style="font-family: "Arial","sans-serif";">C:\Program
Files\CodeBlocks\MinGW\include</span></strong>"<span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 48.0pt; mso-list: l1 level2 lfo2; mso-para-margin-left: 0gd; text-indent: -24.0pt;">
<!--[if !supportLists]--><span lang="EN-US" style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><strong><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 10pt;">add_to_codeblocks_mingw_lib </span></strong><strong><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 新細明體, serif; font-size: 10pt;">內容複製到</span></strong><strong><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 新細明體, serif; font-size: 10pt; font-weight: normal;">→</span></strong><strong><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 10pt; font-weight: normal;"><br />
</span></strong><span class="apple-converted-space"><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 10pt;"> </span></span><span lang="EN-US" style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Arial, sans-serif; font-size: 10pt;">"</span><strong><span style="font-family: "Arial","sans-serif";">C:\Program
Files\CodeBlocks\MinGW\lib</span></strong>"<span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<span lang="EN-US" style="font-family: "Calibri","sans-serif"; font-size: 12.0pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;"><br clear="all" style="mso-special-character: line-break; page-break-before: always;" />
</span>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟</span><span lang="EN-US">Openframework</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">範例</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo3; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">1.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟</span><span lang="EN-US">of_v0071_win_cb_release</span><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">資料夾</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo3; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">2.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">選擇</span><span lang="EN-US">example / gl / billboardExample<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo3; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">3.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">開啟檔案</span><span lang="EN-US">billboardExample.cbp<o:p></o:p></span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo3; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">4.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">建立並執行檔案,選擇</span><span lang="EN-US">Build / Build
and Run (F9)</span></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-list: l0 level1 lfo3; mso-para-margin-left: 0gd; text-indent: -18.0pt;">
<!--[if !supportLists]--><span lang="EN-US">5.<span style="font-size: 7pt;">
</span></span><!--[endif]--><span style="font-family: "新細明體","serif"; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 新細明體; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin;">程式編譯完後便可看到執行畫面</span><span lang="EN-US"><o:p></o:p></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtXrjd8xV9UXOJjAn96epQHe9RldZJZt8DA9Dbm-s7hxqrZUFyG7wajaqsMSUitSulwckNmMX4n6QlK3j5QgoDZ2llpI9fOn-q4c6k6EylvnZYg64HpGMxiy8OKQkp0Wtv3hK9BTt0ZWk/s1600/%E6%93%B7%E5%8F%96.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="295" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtXrjd8xV9UXOJjAn96epQHe9RldZJZt8DA9Dbm-s7hxqrZUFyG7wajaqsMSUitSulwckNmMX4n6QlK3j5QgoDZ2llpI9fOn-q4c6k6EylvnZYg64HpGMxiy8OKQkp0Wtv3hK9BTt0ZWk/s400/%E6%93%B7%E5%8F%96.JPG" width="400" /></a></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
<div class="MsoListParagraph" style="margin-left: 18.0pt; mso-para-margin-left: 0gd;">
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-44428290512307710862012-07-05T02:58:00.000-07:002012-07-05T02:58:17.294-07:00[Puredata] workshop day3_阻力<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHdjduILwg0-WrZh37ayRC_hf-vLVcA37ZULeN6-wpuDpCUm88vBuOUEr-ZhJG7xpnJDtH9bjVIUAf7vvU3yD570FxHRVCxA-pOmrxi5wXjJu9pIoM-9TAXorp7ge8s1S_jzJyPpW1b80/s1600/90.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHdjduILwg0-WrZh37ayRC_hf-vLVcA37ZULeN6-wpuDpCUm88vBuOUEr-ZhJG7xpnJDtH9bjVIUAf7vvU3yD570FxHRVCxA-pOmrxi5wXjJu9pIoM-9TAXorp7ge8s1S_jzJyPpW1b80/s1600/90.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHdjduILwg0-WrZh37ayRC_hf-vLVcA37ZULeN6-wpuDpCUm88vBuOUEr-ZhJG7xpnJDtH9bjVIUAf7vvU3yD570FxHRVCxA-pOmrxi5wXjJu9pIoM-9TAXorp7ge8s1S_jzJyPpW1b80/s1600/90.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<div style="margin-left: 1em; margin-right: 1em; text-align: left;">
</div>
<br />
1. split<br />
<br />
<ul>
<li><span style="background-color: white;">判斷大小值,若大於0.1便從左方輸出,若小於500便從右方輸出</span></li>
<li><span style="background-color: white;">輸出值不斷減二,但因為split,數值若低於0.1,就不會往下傳</span></li>
</ul>
<br />
<br />
2.key<br />
<br />
<ul>
<li><span style="background-color: white;">設定空白鍵,按下空白鍵,score+10</span></li>
<li><span style="background-color: white;">但因為split,數值若高於500,就不會往下傳
</span></li>
</ul>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHdjduILwg0-WrZh37ayRC_hf-vLVcA37ZULeN6-wpuDpCUm88vBuOUEr-ZhJG7xpnJDtH9bjVIUAf7vvU3yD570FxHRVCxA-pOmrxi5wXjJu9pIoM-9TAXorp7ge8s1S_jzJyPpW1b80/s1600/90.PNG" imageanchor="1" style="background-color: white; clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHdjduILwg0-WrZh37ayRC_hf-vLVcA37ZULeN6-wpuDpCUm88vBuOUEr-ZhJG7xpnJDtH9bjVIUAf7vvU3yD570FxHRVCxA-pOmrxi5wXjJu9pIoM-9TAXorp7ge8s1S_jzJyPpW1b80/s1600/90.PNG" /></a></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-37911985049592970442012-07-05T02:05:00.003-07:002012-07-05T02:47:34.548-07:00[Puredata] workshop day3_gem advance 2<div class="separator" style="clear: both; text-align: left;">
1.repeat</div>
<div class="separator" style="clear: both; text-align: left;">
Object,repeat,重複執行,後方數字為重複次數</div>
<div class="separator" style="clear: both; text-align: left;">
在repeat下接translateXYZ,每重複產生一個圓形,位置便往右邊0.2</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiITKRY-3bFG6HQy7T5bUohDTPPQsawkZfBkNrjnXOL1OwTPJJKyaLzbg8_9GhLPCOLUylLx5MWIUKFtWxjXlevuvIi7P4ncdFb0IyEfl-sv8a1wgpln3GKrOvGRFN7B2pGqhOXfFpNzNE/s1600/76.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiITKRY-3bFG6HQy7T5bUohDTPPQsawkZfBkNrjnXOL1OwTPJJKyaLzbg8_9GhLPCOLUylLx5MWIUKFtWxjXlevuvIi7P4ncdFb0IyEfl-sv8a1wgpln3GKrOvGRFN7B2pGqhOXfFpNzNE/s1600/76.PNG" /></a></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXPbQY0_Z-pKTnl3oQd7Qh-a8m_LJo-j0Y-ruq9tR38582lA6dfw_RCiBuUtwFUZSt1fFxeuUX-RbKIchjTprhdQfUuNhonZTDKRaPzcPK3T4L1uqEdHD3AKSqvw7ilr3V-gRZWSeBH9w/s1600/77.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXPbQY0_Z-pKTnl3oQd7Qh-a8m_LJo-j0Y-ruq9tR38582lA6dfw_RCiBuUtwFUZSt1fFxeuUX-RbKIchjTprhdQfUuNhonZTDKRaPzcPK3T4L1uqEdHD3AKSqvw7ilr3V-gRZWSeBH9w/s320/77.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
2. 若使用上separator,每個位置都會在(0.2, 0)</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2_u2xRgh1k9ClJKT6zytUvYXwpHimqDV1pw82KONTEePfa5qIWtK4ShF71xXxXQ8wylFFqbnV84ahOQJGyPGwG9HFteDQ6NYxS9i7huh49MBEYIBwCYn331nIeK_eU-WBk3v7rd2SjaE/s1600/78.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2_u2xRgh1k9ClJKT6zytUvYXwpHimqDV1pw82KONTEePfa5qIWtK4ShF71xXxXQ8wylFFqbnV84ahOQJGyPGwG9HFteDQ6NYxS9i7huh49MBEYIBwCYn331nIeK_eU-WBk3v7rd2SjaE/s1600/78.PNG" /></a></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOqv3iODzXJBIcqTpYf666pSWo436jNNVnB7RKyuzehYsXQ3A-OjRZto3gujuYOpiKC7f24BPiIs_48MTd08Lr4VwQGbikEsf5EoiYJr1sUPTmxI7npFH4To-2J_uiywiXpsUH8xxG9zA/s1600/79.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOqv3iODzXJBIcqTpYf666pSWo436jNNVnB7RKyuzehYsXQ3A-OjRZto3gujuYOpiKC7f24BPiIs_48MTd08Lr4VwQGbikEsf5EoiYJr1sUPTmxI7npFH4To-2J_uiywiXpsUH8xxG9zA/s320/79.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
3. Array</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li style="text-align: left;"><span style="background-color: white;">使用array放置每一個圓球的位置</span></li>
<li style="text-align: left;"><span style="background-color: white;">array,put / Array</span></li>
<li style="text-align: left;"><span style="background-color: white;">name裡設置array的名稱</span></li>
<li style="text-align: left;"><span style="background-color: white;">size裡設定array的大小</span></li>
</ul>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZkySghlCF7ejqm5bPDYssrUx-idldIjqMEQwNPnUGofQdJLV-1mQrYlLqADm2xEK3eQQ2mEKhyT4EO2dORXd9HquRzkPDbeGp_2Nn47HK3a2fyyxGA71Kydn6JlQHZWgh0bdu67YPERQ/s1600/86.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZkySghlCF7ejqm5bPDYssrUx-idldIjqMEQwNPnUGofQdJLV-1mQrYlLqADm2xEK3eQQ2mEKhyT4EO2dORXd9HquRzkPDbeGp_2Nn47HK3a2fyyxGA71Kydn6JlQHZWgh0bdu67YPERQ/s1600/86.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
4. tabread</div>
<div style="text-align: left;">
</div>
<ul>
<li style="text-align: left;"><span style="background-color: white;">Object,tabread,讀取array,後方接array的名稱</span></li>
<li style="text-align: left;"><span style="background-color: white;">輸入值為array的位置,輸出值為該位置的數值</span></li>
<li style="text-align: left;"><span style="background-color: white;">下方陣列名稱為train,size為5</span></li>
</ul>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOWV9SSJ9n5BKpluvn6DdZkcBLUG18bsRI1bHxcjIRqTPrGvtAt5_NsmIlLWo3lvI6JcUUTKFyFYTk1Nywb9RoZbJswjfgj1siopHel984PMboM-x7pBxa50mCE7mJZcdW42-HL_3NoRI/s1600/80.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOWV9SSJ9n5BKpluvn6DdZkcBLUG18bsRI1bHxcjIRqTPrGvtAt5_NsmIlLWo3lvI6JcUUTKFyFYTk1Nywb9RoZbJswjfgj1siopHel984PMboM-x7pBxa50mCE7mJZcdW42-HL_3NoRI/s1600/80.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
5. 動態讀取array</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li style="text-align: left;"><span style="background-color: white;">使用counter計數從0~9,讀取每一個位置的值</span></li>
</ul>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxA6rtARVch_0PUFzLiYdtekj6rErjsrNYgH2oS51nBnFCF72wp9q3vHBVumP0UaB3Xr4BHw6YfABxFe_3qnwId0XrJGKGVkcPYAOMS-4gqVm6wXO9Vwmp4igVbR01_x70UpYW_GxtTvo/s1600/81.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxA6rtARVch_0PUFzLiYdtekj6rErjsrNYgH2oS51nBnFCF72wp9q3vHBVumP0UaB3Xr4BHw6YfABxFe_3qnwId0XrJGKGVkcPYAOMS-4gqVm6wXO9Vwmp4igVbR01_x70UpYW_GxtTvo/s1600/81.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
6. array的位置控制X,array的內容控制Y,因此array的圖形便會與gem產生的圓相同</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgsRgfi6jySrgxobfbnoT1pWnhtnBdLaXbDbGV_b_EGzuf2ofnOQVSKIgNRiNDRC35KNA_ktDUZIVgJ176UDJAK2PckvIjnoK5LPy_P7-VMl6Z4wupfT13yuXuRMaqpCpt-862JdJCg1g/s1600/82.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgsRgfi6jySrgxobfbnoT1pWnhtnBdLaXbDbGV_b_EGzuf2ofnOQVSKIgNRiNDRC35KNA_ktDUZIVgJ176UDJAK2PckvIjnoK5LPy_P7-VMl6Z4wupfT13yuXuRMaqpCpt-862JdJCg1g/s1600/82.PNG" /></a></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyOfIi4coHASJGrJ9aVth2sxYDqt4kd56r4ai1sBrkYLixAtulTXH5KL9skZDKKcO3FT1f3tGVKRXr8CHtIWnfmHbEMZw0wWKSbQtllx-xmRwLArg8kBrPJ2jtgc8u_0JrbNn40W3G_vk/s1600/83.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyOfIi4coHASJGrJ9aVth2sxYDqt4kd56r4ai1sBrkYLixAtulTXH5KL9skZDKKcO3FT1f3tGVKRXr8CHtIWnfmHbEMZw0wWKSbQtllx-xmRwLArg8kBrPJ2jtgc8u_0JrbNn40W3G_vk/s320/83.PNG" width="320" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
7. 使用array位置控制顏色</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrqgfP_5EVkO9HwCWcH7XlvzIw78eyue_qNFNvfBfaqkTVYSsX3MleMgl8MH2J7I7loZOT5xYTllq9vLr1Kb59hpZf3Y_mejBoeh5ym9GdfUsESoz43AFQe_C-gMHYNyRlSIQdXY2demA/s1600/84.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrqgfP_5EVkO9HwCWcH7XlvzIw78eyue_qNFNvfBfaqkTVYSsX3MleMgl8MH2J7I7loZOT5xYTllq9vLr1Kb59hpZf3Y_mejBoeh5ym9GdfUsESoz43AFQe_C-gMHYNyRlSIQdXY2demA/s1600/84.PNG" /></a></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEHAGtk3RlDMNuT2QGVadnCP7ei8wpkAFjpwj-J-7qAKsLGGHDaNDHJWniJiPBTA4lBabHO84-BhmzIdb3f9vtqp7tlsd46nxLlSIDpav2oz6K8-nmFk5IKaj4XV-B9GIpT5-pSddWU_s/s1600/85.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEHAGtk3RlDMNuT2QGVadnCP7ei8wpkAFjpwj-J-7qAKsLGGHDaNDHJWniJiPBTA4lBabHO84-BhmzIdb3f9vtqp7tlsd46nxLlSIDpav2oz6K8-nmFk5IKaj4XV-B9GIpT5-pSddWU_s/s1600/85.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
8. 使用滑鼠的Y傳數值給array,使用tabwrite寫入,右邊的輸入值為array位置</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIhkvC6-H1yCu19BovgoVqwvhicaYJ0I6lPofOK9Rvzakwd5UDagBQlBC1vdSTgk7Bz4HfQRGTqQniCi1Uh1M-A4nqxHCFDDGsxD2Cia-R5Cr2FXtzHCpnnJsDjY2-nYO7LPpiN0u-aoQ/s1600/87.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIhkvC6-H1yCu19BovgoVqwvhicaYJ0I6lPofOK9Rvzakwd5UDagBQlBC1vdSTgk7Bz4HfQRGTqQniCi1Uh1M-A4nqxHCFDDGsxD2Cia-R5Cr2FXtzHCpnnJsDjY2-nYO7LPpiN0u-aoQ/s1600/87.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both;">
8. 使用麥克風的大小傳數值給array,使用tabwrite寫入,右邊的輸入值為array位置</div>
<br class="Apple-interchange-newline" /><br />
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZlBZcG66BdQhFvT3Yvb24MKX1_b9UJnWVkQDWIsmvAcCslWEzeh7gutzdUqLdvd34kRfc94lkkmmwF5GN7f9iNCq-ss36asttjVJdN8Qn5OcHxSZ340CXnKZlmikYb0mXQBBUqPLNaFo/s1600/88.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZlBZcG66BdQhFvT3Yvb24MKX1_b9UJnWVkQDWIsmvAcCslWEzeh7gutzdUqLdvd34kRfc94lkkmmwF5GN7f9iNCq-ss36asttjVJdN8Qn5OcHxSZ340CXnKZlmikYb0mXQBBUqPLNaFo/s1600/88.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: left;">
<br />
9. dsp,下列寫法等同在主控台開始compute audio<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7ZRvNIAYa4b0_DKMAlDOEMpxPoqfgXHdghI0HQpehFBqIggc2MDvu0slzdzFI9pOCu64OiuF6BqPdu02JtcGCOGcVLCt7jLc0qpJDcrCf60q7g7udn-UaMeKOasGoxLj1ZO-1XWnWSOI/s1600/89.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7ZRvNIAYa4b0_DKMAlDOEMpxPoqfgXHdghI0HQpehFBqIggc2MDvu0slzdzFI9pOCu64OiuF6BqPdu02JtcGCOGcVLCt7jLc0qpJDcrCf60q7g7udn-UaMeKOasGoxLj1ZO-1XWnWSOI/s1600/89.PNG" /></a></div>
<br />
<br />
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-63309884379590273912012-07-05T01:25:00.002-07:002012-07-05T01:25:41.326-07:00[Puredata] workshop day3_gem advance 1<div class="separator" style="clear: both; text-align: left;">
1. dimen</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li><span style="background-color: white;">一般使用create, 1接到gemwin即可產生gem,再加上dimen可以調整gem的大小</span></li>
<li><span style="background-color: white;">dimen 螢幕寬度 螢幕高度</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTozDc4wL4WoGNr74R_ANA8fQa6tjPu1B-K7ylUL8Rj83vCynSCDc7HYdcCL4wJZBbLPA3PIn_4thwV34sBytBYY_ipkfeA7AOWeB0v4eDctBN9jrSMD0kV76I04FaIomBPQ_JdP46W9Y/s1600/65.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTozDc4wL4WoGNr74R_ANA8fQa6tjPu1B-K7ylUL8Rj83vCynSCDc7HYdcCL4wJZBbLPA3PIn_4thwV34sBytBYY_ipkfeA7AOWeB0v4eDctBN9jrSMD0kV76I04FaIomBPQ_JdP46W9Y/s1600/65.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
2. 若要寫兩個圖形可使用兩個gemhead產生,或者使用t a a,接上兩個圖形</div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_64lznf55m08JaC2SJ_bMf0UBHe6e3EKzFJs7ftIM02A7QWZPXA555cVSpI-4tbyH6RHCmdiUJVYe8MuaUqRMROumty7s3K479KUH5yQPSyQvSRxzoEikqKr7IYTIMIFXcT_rxf2o2wU/s1600/66.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_64lznf55m08JaC2SJ_bMf0UBHe6e3EKzFJs7ftIM02A7QWZPXA555cVSpI-4tbyH6RHCmdiUJVYe8MuaUqRMROumty7s3K479KUH5yQPSyQvSRxzoEikqKr7IYTIMIFXcT_rxf2o2wU/s1600/66.PNG" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
3. 當我們要控制圖形位置,需使用translateXYZ</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRPXAvEP34oZj_A7m2LFKKEXK8udGLqO03_9_iVhDo4vIJ-Y7MctbuWKTVwu0aO1GR4JFtzM3-RPSOMncTziui71FUFOA_JNtttXw5jC4hMtIork-N5qVRYCmhD2YCJ04cDbPW3_qy29w/s1600/67.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRPXAvEP34oZj_A7m2LFKKEXK8udGLqO03_9_iVhDo4vIJ-Y7MctbuWKTVwu0aO1GR4JFtzM3-RPSOMncTziui71FUFOA_JNtttXw5jC4hMtIork-N5qVRYCmhD2YCJ04cDbPW3_qy29w/s1600/67.PNG" /></a></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK3_ieZ7Rs7g-ksvvIRFCSCJbrZg3gfyjP6fFAyFJ-L4nlMWs42uVML__0-HSPtLo_VDzm4mNnWv29tCEOrTZuCXj0I7QXpiypC7TQuPXY843YOrI0nhMGpmrrETCk_rQ_TAxU5BEDPtI/s1600/68.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK3_ieZ7Rs7g-ksvvIRFCSCJbrZg3gfyjP6fFAyFJ-L4nlMWs42uVML__0-HSPtLo_VDzm4mNnWv29tCEOrTZuCXj0I7QXpiypC7TQuPXY843YOrI0nhMGpmrrETCk_rQ_TAxU5BEDPtI/s320/68.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: left;">
4. 若使用一個gemhead產生,因為t a a由右執行到左的特性, 左邊的translateXYZ會被右邊的translateXYZ影響,也就是說,circle會先執行square的<span style="background-color: white;">translateXYZ,也就是X位移1、Y位移1,再執行自己的</span><span style="background-color: white;">translateXYZ,</span><span style="background-color: white;">X位移1、Y位移-1</span></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPbcOEyhMjG0Xdv82HCXJfXYgOwf_c4QM8vvk5d0LteC41F9QpKL65bXuXYtFoWMZeKACXZhyphenhyphenkIJ2i8gmdSMjPCiltU_UL-wVJIaKH7WcAK-iiFXhZ_4vGk-R2v6P6Y0spW858ha0Z3I0/s1600/69.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPbcOEyhMjG0Xdv82HCXJfXYgOwf_c4QM8vvk5d0LteC41F9QpKL65bXuXYtFoWMZeKACXZhyphenhyphenkIJ2i8gmdSMjPCiltU_UL-wVJIaKH7WcAK-iiFXhZ_4vGk-R2v6P6Y0spW858ha0Z3I0/s1600/69.PNG" /></a></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnrkBMvBIwNJMMoar2oTqxFht4FviWYahn8maOJJEAimRKToleq1m87wh8K3Xa45thuXGAGN2H9TtPPDuwka6H85TECHFSnpdzXWCCKph96cXhiDndioy4EX9XK4vQYlxopizBGfh_YHo/s1600/70.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnrkBMvBIwNJMMoar2oTqxFht4FviWYahn8maOJJEAimRKToleq1m87wh8K3Xa45thuXGAGN2H9TtPPDuwka6H85TECHFSnpdzXWCCKph96cXhiDndioy4EX9XK4vQYlxopizBGfh_YHo/s320/70.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: left;">
5. 為避免彼此影響,使用separator再接上translateXYZ,便可將指令分開</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWKHaXF9s-SiNYvH69akin3M5xcq7afrCBa3iMaCcxsbtR0wF7tUsRIBPzY-c_7WZYgBW58CvsM2ecU7igk3TOZSNxk0iQfL7Q5pK8UCVHQwXQFX7TeD7etWrYgrv-vXvmpDcwFb8msjg/s1600/71.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWKHaXF9s-SiNYvH69akin3M5xcq7afrCBa3iMaCcxsbtR0wF7tUsRIBPzY-c_7WZYgBW58CvsM2ecU7igk3TOZSNxk0iQfL7Q5pK8UCVHQwXQFX7TeD7etWrYgrv-vXvmpDcwFb8msjg/s1600/71.PNG" /></a></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXn0OJf2QdCgrRRhX2-TcFwz93hP1WWkdPxXK7pnVk-hQz_U4qa7Ib6SY_yf-SkemW47frG3XJNv6lDdIFqOqhbZtohcszplOxyONYBvcRwbrlFb2hG4MBLAo_Vm6dW1TgH494Z5blnhY/s1600/72.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXn0OJf2QdCgrRRhX2-TcFwz93hP1WWkdPxXK7pnVk-hQz_U4qa7Ib6SY_yf-SkemW47frG3XJNv6lDdIFqOqhbZtohcszplOxyONYBvcRwbrlFb2hG4MBLAo_Vm6dW1TgH494Z5blnhY/s320/72.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
6. 公轉</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li><span style="background-color: white;">使用Toggle、metro、counter,做一個0~360的計數器,使用rotateXYZ,讓circle跟square同步旋轉</span></li>
</ul>
<br />
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsBquH2AIIktx9AXXC-fLzOxXprgc6chioeyh5eAfoYyHZHwSU7L-PBVktTM4nsP5SeJjjxD-aGwFc6PcOjtVPK9VblSISMOPZlYqPHm7bmldovtcD-OwPnnbCbWjFJsa9gR3Nba7ZnQI/s1600/73.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsBquH2AIIktx9AXXC-fLzOxXprgc6chioeyh5eAfoYyHZHwSU7L-PBVktTM4nsP5SeJjjxD-aGwFc6PcOjtVPK9VblSISMOPZlYqPHm7bmldovtcD-OwPnnbCbWjFJsa9gR3Nba7ZnQI/s1600/73.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
7. 自轉</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li><span style="background-color: white;">在separator之後接上rotateXYZ,便可使方塊除了與圓形一起公轉,還擁有自己的自轉</span></li>
</ul>
<br />
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYz1fEEOfJyU22OLcGYWNwvgqeOtxKyHG1SLtlKAs0xEHxvWnmxjEmJUXx9GTWTOZSKsbfLC8othZ0HZmpVQClE9WKJJx58IKr_erGGWC2BzPm74udfhuZo7I2SuimsdekAAUpBJDSZpg/s1600/74.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYz1fEEOfJyU22OLcGYWNwvgqeOtxKyHG1SLtlKAs0xEHxvWnmxjEmJUXx9GTWTOZSKsbfLC8othZ0HZmpVQClE9WKJJx58IKr_erGGWC2BzPm74udfhuZo7I2SuimsdekAAUpBJDSZpg/s1600/74.PNG" /></a></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsUtn9iLoDoEsgWwshh8kVLhUIetLr55H6jQnbdqgRMq-s32D1CSR2VzyDUr61i4HBQiZgzVry-JZqPYQ3XlGKQ2KpAQ3nKxcjLpfoNuDoJgCdPYTKPqSIxGfXElr25awFNUcojK6dqFw/s1600/75.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsUtn9iLoDoEsgWwshh8kVLhUIetLr55H6jQnbdqgRMq-s32D1CSR2VzyDUr61i4HBQiZgzVry-JZqPYQ3XlGKQ2KpAQ3nKxcjLpfoNuDoJgCdPYTKPqSIxGfXElr25awFNUcojK6dqFw/s320/75.PNG" width="320" /></a></div>
<div style="text-align: left;">
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-36613265993328078972012-07-04T17:21:00.002-07:002012-07-04T17:21:42.577-07:00[Puredata] workshop day2_make a little game 21. 建立一個由使用者 /玩家操控的主角<br />
<br />
<ul>
<li><span style="background-color: white;">開啟新檔,命名為player</span></li>
<li><span style="background-color: white;">畫一個圓來當作主角,顏色選用與ball不同</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxw2lOYgxH86QV2C9o0l7sQKeUe0L6yDy1R9gcooYxPduD1sGgg4KQZcN6Nr4n2wR9um98mm7DWUARsZQGQt3M0F-kh3Is2UNoFOXv6CzgrOXK1k0I8_V4aVeJES5WzmLYoNGxFynzZYE/s1600/54.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxw2lOYgxH86QV2C9o0l7sQKeUe0L6yDy1R9gcooYxPduD1sGgg4KQZcN6Nr4n2wR9um98mm7DWUARsZQGQt3M0F-kh3Is2UNoFOXv6CzgrOXK1k0I8_V4aVeJES5WzmLYoNGxFynzZYE/s1600/54.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtDGbftlZSvotOgg99Ye2I1h7ww7H1jUZdhR1Lyp41lUydOBlNR0PnKgXB7EJ_Fqx-nOMYv4AL7fGLwevMEG50X0zUaEfXLeFXPnWnMEiRSsIVZApOQ5oVTZT4pjMrgaiJP7LKo2nHgQQ/s1600/55.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtDGbftlZSvotOgg99Ye2I1h7ww7H1jUZdhR1Lyp41lUydOBlNR0PnKgXB7EJ_Fqx-nOMYv4AL7fGLwevMEG50X0zUaEfXLeFXPnWnMEiRSsIVZApOQ5oVTZT4pjMrgaiJP7LKo2nHgQQ/s320/55.PNG" width="306" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
2. 替玩家設立預設出現位置<br />
<br />
<ul>
<li><span style="background-color: white;">使用translateXYZ來改變玩家位置</span></li>
<li><span style="background-color: white;">使用$來建立變數</span></li>
<li><span style="background-color: white;">運用Message,在主控台顯示此物件各種變數代表意義</span></li>
<li><span style="background-color: white;">設立全域變數,使用v,半徑為playerR,X為playerX,Y為playerY</span></li>
<li>可建立subpatch,讓畫面較為整潔</li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRvbUHonvC-9e-r5hINXpuj54B7f78tOEsW97UYitrUFkrsdCpzWUyKujPa5vwLaD07CTde-E5q-sPsFvw4BwX9lk1-v1grNMruLA-he1P0T3YkFKCMbmK8kQN6Na16xhrhDMWw8-ass0/s1600/56.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRvbUHonvC-9e-r5hINXpuj54B7f78tOEsW97UYitrUFkrsdCpzWUyKujPa5vwLaD07CTde-E5q-sPsFvw4BwX9lk1-v1grNMruLA-he1P0T3YkFKCMbmK8kQN6Na16xhrhDMWw8-ass0/s1600/56.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRvbUHonvC-9e-r5hINXpuj54B7f78tOEsW97UYitrUFkrsdCpzWUyKujPa5vwLaD07CTde-E5q-sPsFvw4BwX9lk1-v1grNMruLA-he1P0T3YkFKCMbmK8kQN6Na16xhrhDMWw8-ass0/s1600/56.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRvbUHonvC-9e-r5hINXpuj54B7f78tOEsW97UYitrUFkrsdCpzWUyKujPa5vwLaD07CTde-E5q-sPsFvw4BwX9lk1-v1grNMruLA-he1P0T3YkFKCMbmK8kQN6Na16xhrhDMWw8-ass0/s1600/56.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRvbUHonvC-9e-r5hINXpuj54B7f78tOEsW97UYitrUFkrsdCpzWUyKujPa5vwLaD07CTde-E5q-sPsFvw4BwX9lk1-v1grNMruLA-he1P0T3YkFKCMbmK8kQN6Na16xhrhDMWw8-ass0/s1600/56.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><br />
<br />
<br />
<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEB0cxMIYFz2y6eVBZ-uvZ7CgXaG3Os1avPm09BXLuxlWVR7PGJZKllOt30h-VEA5mv9Ke1F5yenS0i6DGr5h1OtfaOJ0ubk7fT1H4CcscsfftI3Ph-odyZP_pZPiIo1fbORqTI1c0rys/s1600/57.PNG" imageanchor="1" style="background-color: white; clear: left; display: inline !important; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><br /></a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
3. 判斷ball有無碰到player<br />
<br />
<ul>
<li><span style="background-color: white;">回到ball的檔案</span></li>
<li><span style="background-color: white;">為取得是否碰撞,需得知ball的XY,利用send區域變數($0-),傳送XY數值,ball的XY值設定於translateXY的subpatch之中</span><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSMmEQcLiXorhS-yP_LtDPQQOlTN2bULLYclmAtLM2xafecY7lJhcwnfRFMlBOCEOtiw4g6NjvTwn5qkhyphenhyphenE9-jzjy6I-O2ljoUgbT8JQUKTSxinvvfj6BXgjixq1cLzUfgU0Vkp5TWZJU/s1600/58.PNG" imageanchor="1" style="background-color: white; clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSMmEQcLiXorhS-yP_LtDPQQOlTN2bULLYclmAtLM2xafecY7lJhcwnfRFMlBOCEOtiw4g6NjvTwn5qkhyphenhyphenE9-jzjy6I-O2ljoUgbT8JQUKTSxinvvfj6BXgjixq1cLzUfgU0Vkp5TWZJU/s1600/58.PNG" /></a></li>
</ul>
<br />
<br />
<br />
<br />
4. distance<br />
取得ball的位置後便可判別他與player之前的距離<br />
<span style="background-color: white;">在subpatch "translateXY"中建立subpatch "collision ",將程式寫於其中</span><br />
使用 r 取得ball的XY值,取得Y的同時,同步取得player的XY值<br />
Object,distance2d,偵測兩點距離的方式,但由於只有兩個輸入點,利用pack先將xy集合後,再輸入給distance2d<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX5Km4scLd3iAzA31SikXYzLkEe08bKGT0GukByKvjkTJIu6_fxlmvh4INIygV5eLF1LVKqz_cIyM5Kfm-3MdGOtRu1CPhsp7OAkmDnCrv0q3D0eQ09JGxGqEuKu0yBkTDYlfCSeNkafc/s1600/59.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX5Km4scLd3iAzA31SikXYzLkEe08bKGT0GukByKvjkTJIu6_fxlmvh4INIygV5eLF1LVKqz_cIyM5Kfm-3MdGOtRu1CPhsp7OAkmDnCrv0q3D0eQ09JGxGqEuKu0yBkTDYlfCSeNkafc/s1600/59.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
5. 建立碰撞反應<br />
<br />
<ul>
<li><span style="background-color: white;">r 接收ball的半徑,用t f b,把ball的半徑跟player的半徑相加</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0-lROYB4rgvLRkP1FrMs4qW-l1Z4mkzZh4AaDRoOz1Ub-Uv_2BfMYAZNDT_lJCKaueWCzAf22hgeyaPFQUcBBYEijDK2Sn0a2jQKsBH4PiIguI94nlpkg7HO5v2VRYWknIRbEgaDwYRk/s1600/60.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0-lROYB4rgvLRkP1FrMs4qW-l1Z4mkzZh4AaDRoOz1Ub-Uv_2BfMYAZNDT_lJCKaueWCzAf22hgeyaPFQUcBBYEijDK2Sn0a2jQKsBH4PiIguI94nlpkg7HO5v2VRYWknIRbEgaDwYRk/s1600/60.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
6. 產生碰撞<br />
<br />
<ul>
<li><span style="background-color: white;">當距離 <= 兩圓半徑,便產生碰撞</span></li>
<li><span style="background-color: white;">將兩者相比,如果成立,便產生聲音</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBGhAUP-c4Mk1L7hEiG_ssfLTCP2A_mKQr8EHiSessxHMxFl3Y14O20ZG5QMS_dERpJrt4ShPbeGRNEYWp6w6iEvdIO_WYqrAbBkk4xIJASErgY-os7gjj1llU4JQltaZ_RnT37FpkjuY/s1600/61.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBGhAUP-c4Mk1L7hEiG_ssfLTCP2A_mKQr8EHiSessxHMxFl3Y14O20ZG5QMS_dERpJrt4ShPbeGRNEYWp6w6iEvdIO_WYqrAbBkk4xIJASErgY-os7gjj1llU4JQltaZ_RnT37FpkjuY/s1600/61.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
7. 利用判斷碰撞產生視覺回饋<br />
<br />
<ul>
<li><span style="background-color: white;">判斷碰撞後,用s score,將數值傳出</span></li>
<li><span style="background-color: white;">到player的檔案,接收,r score</span></li>
<li><span style="background-color: white;">使用score作為觸發,每當碰撞,便將player的半徑降低</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7y50ywGIzo9QQB-Zu9yyrCLUUwQD8fbV6G2z26pb0EaVPe8Z-CAgLyPnvLdDofs4C5RymXDUp-tlsHcW26m3v5fV5SDjEXNLYd7E8j-2DZ3EsoQqTZ5-4UGjFbC-py87u7elVa0_CUIk/s1600/63.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7y50ywGIzo9QQB-Zu9yyrCLUUwQD8fbV6G2z26pb0EaVPe8Z-CAgLyPnvLdDofs4C5RymXDUp-tlsHcW26m3v5fV5SDjEXNLYd7E8j-2DZ3EsoQqTZ5-4UGjFbC-py87u7elVa0_CUIk/s1600/63.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixJ9My9d4ityHukhZl5DMNCahCsXGAfPBBPo467IKMqa2qboFxyT5LJeGUw8-6bur5HW1UaeXMbujrtNKz79dWnGtvCRP-yDTEgz5CK7tPZ_5k2vqDNRIrHLmYLvEkAxBZP2TB7oZecn0/s1600/64.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixJ9My9d4ityHukhZl5DMNCahCsXGAfPBBPo467IKMqa2qboFxyT5LJeGUw8-6bur5HW1UaeXMbujrtNKz79dWnGtvCRP-yDTEgz5CK7tPZ_5k2vqDNRIrHLmYLvEkAxBZP2TB7oZecn0/s1600/64.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-77210144798321408992012-07-04T03:14:00.000-07:002012-07-04T17:22:05.096-07:00[Puredata] workshop day2_make a little game 11. 開啟新檔,檔案名稱為"start"<br />
<div>
<br />
<ul>
<li><span style="background-color: white;">使用loadbang,讓檔案一執行便開啟視窗</span></li>
</ul>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo1OBMhx_dQDzYFAZ60hVqHtOyQDybT1_ElI0_zMjRPBrsIv7A9Xi4yaG702bf12i9XWZuCzYpKgVL9wEEKPHMAXDKZ7j-oi9GKi_zm8WKwVlXCfizNm4pHpKQvcBV9NfHUF3j6Z_STOc/s1600/38.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo1OBMhx_dQDzYFAZ60hVqHtOyQDybT1_ElI0_zMjRPBrsIv7A9Xi4yaG702bf12i9XWZuCzYpKgVL9wEEKPHMAXDKZ7j-oi9GKi_zm8WKwVlXCfizNm4pHpKQvcBV9NfHUF3j6Z_STOc/s1600/38.PNG" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br />
<br />
<br />
2. 開啟新檔,檔案名稱為"mainboard"</div>
<div>
<br />
<ul>
<li><span style="background-color: white;">mainboard為主要程式區,將其他程式以patch的方式呼叫到mainboard之中</span></li>
<li><span style="background-color: white;">將步驟1建立的檔案,在mainboard中呼叫</span></li>
<li><span style="background-color: white;">PS. 以執行模式點選呼叫的程式,可以直接開啟程式內容</span></li>
</ul>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4jkUeTmJZvcGJZo-qa0HQQ0mE_VJOfuPuDd-SEpWxsSDBXpFVvJV0ehb3gADUefChpZAxFcuMp_kOtv621XVAbrYhiO90885M41oNkGSkI-FLqvQdbpMD9Q4ESkE9OYcdNZ-KG0AosK0/s1600/39.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4jkUeTmJZvcGJZo-qa0HQQ0mE_VJOfuPuDd-SEpWxsSDBXpFVvJV0ehb3gADUefChpZAxFcuMp_kOtv621XVAbrYhiO90885M41oNkGSkI-FLqvQdbpMD9Q4ESkE9OYcdNZ-KG0AosK0/s1600/39.PNG" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br />
<br />
3. 開啟新檔,檔案名稱為"ball"</div>
<div>
<br />
<ul>
<li><span style="background-color: white;">此檔案為建立圓形用</span></li>
</ul>
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZVG3e8eTvJ6rxcW20crYsKBamDtSw2rqpF4fgS50RxRSq6iAW28cztrb8TA-0BfxWxRV9baWqmlU__LieAj542T4Y30STYVl1b-HJXNw6CkLmALuHWxDi7623iA6PIIr1kC7tv-0Qe5o/s1600/40.PNG" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZVG3e8eTvJ6rxcW20crYsKBamDtSw2rqpF4fgS50RxRSq6iAW28cztrb8TA-0BfxWxRV9baWqmlU__LieAj542T4Y30STYVl1b-HJXNw6CkLmALuHWxDi7623iA6PIIr1kC7tv-0Qe5o/s1600/40.PNG" /></a>
<br />
<br />
4. 讓圓形開始移動,執行模式點選reset旁的0,即可歸零位置<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTznKKXsdDDZjgYARnlIkbSL4ujiX_xRT2BKGxXCOGnVafDA7MwDL4ql4RbR0MPidKzE1oyyuz-u_JUzmkmGaPo-W_LwnZulio-t8RyhQLQV5b5Zivuz2J-jyph_5yNN1tGAS4KBriRIc/s1600/41.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTznKKXsdDDZjgYARnlIkbSL4ujiX_xRT2BKGxXCOGnVafDA7MwDL4ql4RbR0MPidKzE1oyyuz-u_JUzmkmGaPo-W_LwnZulio-t8RyhQLQV5b5Zivuz2J-jyph_5yNN1tGAS4KBriRIc/s1600/41.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
5. 為了讓圓形遇到邊界可以反向,建立判別式 >4 、 <-4<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim6HZw6SeA-_XIP-tS2AnV4Lh7wmJbvuxGEnibA6xMzV8oUZ5oStl_bdKgqWq_33dsTCB-SDZ2N8I9qUQLQFvFW4veZQHR6DV2wwXsUWkHX-ffuYrd5qF3PMVJujU5nIAFC49Q49-gEYY/s1600/42.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim6HZw6SeA-_XIP-tS2AnV4Lh7wmJbvuxGEnibA6xMzV8oUZ5oStl_bdKgqWq_33dsTCB-SDZ2N8I9qUQLQFvFW4veZQHR6DV2wwXsUWkHX-ffuYrd5qF3PMVJujU5nIAFC49Q49-gEYY/s1600/42.PNG" /></a>
<br />
<br />
<br />
6. 利用設定區域變數,讓畫面看起來更乾淨<br />
區域變數宣告方式為" $0- " 加上變數名稱<br />
s為send的意思,傳送值,s $0-xVector,傳送一個區域變數名稱為<span style="background-color: white;">xVector</span><br />
r,<span style="background-color: white;">receive</span><span style="background-color: white;">,</span><span style="background-color: white;">接收值,</span><span style="background-color: white;">r $0-xVector,接受一個區域變數名稱為</span><span style="background-color: white;">xVector</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibocVYBz4GxGrL8Y8J8QJzWFe4KLUTfHFf38BuPNDq0OXEJY-JUWJjBsblHHqHfEsfWP9sM4JQlxzNFnCec1PgZu2woi6mrTVWtSyPfc29kBEhbhxMOwc-NM8Ylj3KTaup7dJxEcXGx0Q/s1600/43.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibocVYBz4GxGrL8Y8J8QJzWFe4KLUTfHFf38BuPNDq0OXEJY-JUWJjBsblHHqHfEsfWP9sM4JQlxzNFnCec1PgZu2woi6mrTVWtSyPfc29kBEhbhxMOwc-NM8Ylj3KTaup7dJxEcXGx0Q/s1600/43.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
7. 每個圓形的起始位置都不一樣,才會有趣<br />
<br />
<ul>
<li><span style="background-color: white;">使用loadbang,讓ball的程式一執行便設定隨機位置,給值到步驟四所提到的f迴圈之中</span></li>
<li><span style="background-color: white;">設定一個變數,$1,並且把值給到circle,讓ball可以控制大小</span></li>
<li>下圖中,Y_translate的r $0-xVector與 s $0-xVector有誤, 改為
r $0- yVector與
s $0-yVector</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVqnokXw81bA7fAzjvzrPhJ-8BFXPf1JwnfT3BwV3FYbjPu3tbApQVbKenx3b5xfNZ0ciXz6FDuwsF9a1EY-XbC5b-7CaVt4jantwF2JoXWE1rdtzoyXlNdU2fG8e3C8zQLXBSLd_2KtU/s1600/44.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVqnokXw81bA7fAzjvzrPhJ-8BFXPf1JwnfT3BwV3FYbjPu3tbApQVbKenx3b5xfNZ0ciXz6FDuwsF9a1EY-XbC5b-7CaVt4jantwF2JoXWE1rdtzoyXlNdU2fG8e3C8zQLXBSLd_2KtU/s1600/44.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
8. 產生兩顆球,大小分別為0.3、0.1<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjIKLF1m5VBra5vZRXNRnotNW0HdGyFuZZ_j8HKoMhVTHHdnw9Ecn-haWWxqI5XBvOSdPUItGBU9pCrrOeCWskHJ03cUwHUe__Ph0yiuX-31w-dWiJBoHtIMFpNwKKcacR10YJwXpDaHI/s1600/45.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjIKLF1m5VBra5vZRXNRnotNW0HdGyFuZZ_j8HKoMhVTHHdnw9Ecn-haWWxqI5XBvOSdPUItGBU9pCrrOeCWskHJ03cUwHUe__Ph0yiuX-31w-dWiJBoHtIMFpNwKKcacR10YJwXpDaHI/s1600/45.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
9. 使用subpatch讓版面更整齊<br />
<br />
<ul>
<li><span style="background-color: white;">下圖中,Y_translate的r $0-xVector與</span><span style="background-color: white;"> s</span><span style="background-color: white;"> $0-xVector有誤,</span><span style="background-color: white;"> 改為</span><span style="background-color: white;"> </span><span style="background-color: white;">r $0-</span><span style="background-color: white;"> </span><span style="background-color: white;">y</span><span style="background-color: white;">Vector與</span><span style="background-color: white;"> </span><span style="background-color: white;">s</span><span style="background-color: white;"> $0-yVector</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRsFqXwUbTdWtIFzhXYCGjvhdr43OOZJpWsrti6mAEljCZtVrXpsNrovzmhg5chN1jQzRYFb_qrpcPsyz_UvVvASTxTOKBjwPPNNNN4THYhk1BKn14wlm6vj_gId9SaMR4ig0KSC4SSCs/s1600/46.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRsFqXwUbTdWtIFzhXYCGjvhdr43OOZJpWsrti6mAEljCZtVrXpsNrovzmhg5chN1jQzRYFb_qrpcPsyz_UvVvASTxTOKBjwPPNNNN4THYhk1BKn14wlm6vj_gId9SaMR4ig0KSC4SSCs/s1600/46.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
10. 設定圓形的顏色,使用阿亂怪招<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX9mTZ1Xs5azWCb9NRqCXuPfoWUmzWXbCJERZdPpokhFDzxcSp_3wzZdefk_rwdH0MvFIoGAnyqzkf_UOXI0kXGSiudpjrKrst0aFg9rOg3VmLMKetGjKnBhaFmBW0zEf4767qXcC0LMA/s1600/47.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX9mTZ1Xs5azWCb9NRqCXuPfoWUmzWXbCJERZdPpokhFDzxcSp_3wzZdefk_rwdH0MvFIoGAnyqzkf_UOXI0kXGSiudpjrKrst0aFg9rOg3VmLMKetGjKnBhaFmBW0zEf4767qXcC0LMA/s1600/47.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
11. 運用$1的變數,改變半徑後也改變速度<br />
建立一個subpatch,名稱為"meta",存放初始值,將步驟7的set position original放置到meta之中<br />
$1傳送進後,使用t f f f,傳送正負值的速度跟半徑<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMOPIXKxUjfEbwPfVrW2rP6m_SO_KbTWq8NJrY2gEoAewi0_SMBZ48kyvANh9JEEkk7UhMeRcVpKNZvmbdrXzgf2ygCZ-RgWKmjPwloNJzzCTJL6fsjOXr8zTA-nrucwKTdBut6ZCxhu8/s1600/48.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivqJ5BdxkQ59LWeghQe_xv9G4BivZz3l0hYbvGJEzb0_XyyOVI4raB-5IRqcCcQr9pfMuvRjVSRfPgJOSAMjlUJpgakjLiFuCYFkArB92Ki2F_7J54kXbW5IQARUJ4zLjdA6Okr0yypBs/s1600/48.PNG" imageanchor="1" style="background-color: white; clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivqJ5BdxkQ59LWeghQe_xv9G4BivZz3l0hYbvGJEzb0_XyyOVI4raB-5IRqcCcQr9pfMuvRjVSRfPgJOSAMjlUJpgakjLiFuCYFkArB92Ki2F_7J54kXbW5IQARUJ4zLjdA6Okr0yypBs/s1600/48.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
12. 讓球碰撞到有聲音,設定一個subpatch"sound"<br />
<br />
<ul>
<li><span style="background-color: white;">在main中新增一個dac~</span></li>
<li><span style="background-color: white;">使用throw~,將聲音訊號丟到main中的dac~,throw~就像是send訊息一樣,只是傳送的是音訊,一樣要設置變數,main中則是用catch~來接收</span></li>
<li><span style="background-color: white;">Message,1,0 200,從一到零,時間200毫秒,接到line,讓它呈線性變化,因此可以產生漸強漸弱的音量</span></li>
<li><span style="background-color: white;">*~後面沒放數字,預設值為零,利用line,傳送1~0的值,使之發出聲音</span></li>
</ul>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1xjlCsU4dEjzxWwVLVDkXKdfTC5OJc7o_SkSFNg_g_8ovGfMZYvFuQiEpk71vVhh63PoGkSgw-4FgF5WiARIW_fJ0HnE8H7YSW8bsu2gXWq3vqv9Xw8K0Fx_69p91WTcjp2LnOZIwwHw/s1600/53.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1xjlCsU4dEjzxWwVLVDkXKdfTC5OJc7o_SkSFNg_g_8ovGfMZYvFuQiEpk71vVhh63PoGkSgw-4FgF5WiARIW_fJ0HnE8H7YSW8bsu2gXWq3vqv9Xw8K0Fx_69p91WTcjp2LnOZIwwHw/s1600/53.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ803RrBaEjPONDX6dNY2HY7ikTLhVDtz0Z4bx27aN3NOw0moVfv6vb9Gg32J2HsO1qrGcNAy1GYujrHYY8mkEXoTSbH0c7ZqFVBsuGyTkn7SCgrCgWCwT3D06E7RJUlYGn656tp25kA8/s1600/49.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ803RrBaEjPONDX6dNY2HY7ikTLhVDtz0Z4bx27aN3NOw0moVfv6vb9Gg32J2HsO1qrGcNAy1GYujrHYY8mkEXoTSbH0c7ZqFVBsuGyTkn7SCgrCgWCwT3D06E7RJUlYGn656tp25kA8/s1600/49.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
13. 當球反彈,便發出聲音,因此將sound subpatch接到判斷式後面,此處使用send跟recive讓畫面更簡潔<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq4O_V6smOr4l1tyUEXAiNMqPhpQhkF8toVgv9GokQ2gLSk-f31X24nq1HlKtd6-HeX69uUY5Gp9FP8J5THEhiOkwuxdATN2FnDlPi_egKbuxOfF-H-y_DYtd3Dq9BfIythzTdq5Ck2zI/s1600/50.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq4O_V6smOr4l1tyUEXAiNMqPhpQhkF8toVgv9GokQ2gLSk-f31X24nq1HlKtd6-HeX69uUY5Gp9FP8J5THEhiOkwuxdATN2FnDlPi_egKbuxOfF-H-y_DYtd3Dq9BfIythzTdq5Ck2zI/s1600/50.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvBmlk1EEgHrc_N-QKTEIPEKHYKD80j419NgRDqiu5hYVuDefNnkf33Z7ZiuciBGBMcAxmyKrexD9evPAuVicDvV7-NvuzRVyzZKjcC4EtJlU6gr3w2beQIFH1dfOeDN9JFPot801ExsI/s1600/51.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvBmlk1EEgHrc_N-QKTEIPEKHYKD80j419NgRDqiu5hYVuDefNnkf33Z7ZiuciBGBMcAxmyKrexD9evPAuVicDvV7-NvuzRVyzZKjcC4EtJlU6gr3w2beQIFH1dfOeDN9JFPot801ExsI/s1600/51.PNG" /></a></div>
<br />
14. 打開主控台的compute audio,就可以聽到聲音了<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-66938446809046013842012-07-03T23:51:00.000-07:002012-07-04T08:43:19.639-07:00[Puredata] workshop day2_呼叫patch1. loadbang<br />
<br />
<ul>
<li><span style="background-color: white;">Object,loadbang,Pd程式一打開即執行</span></li>
<li><span style="background-color: white;">讓程式一開啟便執行關閉視窗,再新開視窗,</span><span style="background-color: white;">有時候Pd已經開了視窗,因此在一開始就先關閉所有開啟的視窗</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo1OBMhx_dQDzYFAZ60hVqHtOyQDybT1_ElI0_zMjRPBrsIv7A9Xi4yaG702bf12i9XWZuCzYpKgVL9wEEKPHMAXDKZ7j-oi9GKi_zm8WKwVlXCfizNm4pHpKQvcBV9NfHUF3j6Z_STOc/s1600/38.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo1OBMhx_dQDzYFAZ60hVqHtOyQDybT1_ElI0_zMjRPBrsIv7A9Xi4yaG702bf12i9XWZuCzYpKgVL9wEEKPHMAXDKZ7j-oi9GKi_zm8WKwVlXCfizNm4pHpKQvcBV9NfHUF3j6Z_STOc/s1600/38.PNG" /></a></div>
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;">2. 呼叫patch</span><br />
<br />
<ul>
<li><span style="background-color: white;">Object,Pd的存檔名稱,若Pd的檔案在同一資料夾下,Pd中可以互相呼叫</span></li>
<li><span style="background-color: white;">比如,第一個檔案名稱為"start.pd",開啟一個新的檔案"mainboard",在其中直接以Object寫入start,即可執行start內的指令</span></li>
<li><span style="background-color: white;">也就是,當start的Object被建立後,會因為loadbang,立即產生一個新的gem視窗</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4jkUeTmJZvcGJZo-qa0HQQ0mE_VJOfuPuDd-SEpWxsSDBXpFVvJV0ehb3gADUefChpZAxFcuMp_kOtv621XVAbrYhiO90885M41oNkGSkI-FLqvQdbpMD9Q4ESkE9OYcdNZ-KG0AosK0/s1600/39.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4jkUeTmJZvcGJZo-qa0HQQ0mE_VJOfuPuDd-SEpWxsSDBXpFVvJV0ehb3gADUefChpZAxFcuMp_kOtv621XVAbrYhiO90885M41oNkGSkI-FLqvQdbpMD9Q4ESkE9OYcdNZ-KG0AosK0/s1600/39.PNG" /></a></div>
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-75854696022139609472012-07-03T20:00:00.004-07:002012-07-03T22:46:10.622-07:00[Puredata] workshop day2_Wiimote with GlovePIEWiimote→GlovePIE→Pure Data<br />
<br />
1. 開啟GlovePIE,貼上下列程式碼<br />
<br />
<br />
<blockquote class="tr_bq">
<i><span style="font-size: x-small;">Wiimote.Led1 = true<br />Wiimote.Led2 = true<br />//Wiimote.Led3 = true<br />//Wiimote.Led4 = true<br />/*<br />var.up = Wiimote.Up<br />var.down = Wiimote.Down<br />var.left = Wiimote.Left<br />var.right = Wiimote.Right<br />var.botA = Wiimote.A<br />var.botB = Wiimote.B<br />var.plus = Wiimote.Plus<br />var.minus = Wiimote.Minus<br />var.home = Wiimote.Home<br />*/<br />var.one = Wiimote.One<br />var.two = Wiimote.Two<br /><br />// OSC - Open Sound Control<br />Osc.ip = "localhost"<br />Osc.port = 7777<br />/*<br />Osc.up = var.up<br />Osc.down = var.down<br />Osc.left = var.left<br />Osc.right = var.right<br />Osc.A = var.botA<br />*/<br />osc.one = var.one<br />osc.two = var.two<br /><br />// OSC end<br />// IR Camera<br />var.pointX = Wiimote.PointerX<br />var.pointY = Wiimote.PointerY<br />var.dot1x = Wiimote.dot1x<br />var.dot1y = Wiimote.dot1y<br />var.dot2x = Wiimote.dot2x<br />var.dot2y = Wiimote.dot2y<br />var.dot3x = Wiimote.dot3x<br />var.dot3y = Wiimote.dot3y<br />var.dot4x = Wiimote.dot4x<br />var.dot4y = Wiimote.dot4y<br /><br />Osc.pox = var.pointX // 0 to 1<br />Osc.poy = var.pointY // 0 to 1<br /><br /><br />Osc.dot1x = float(var.dot1x)/1023<br />Osc.dot1y = float(var.dot1y)/767<br />Osc.dot2x = float(var.dot2x)/1023<br />Osc.dot2y = float(var.dot2y)/767<br />Osc.dot3x = float(var.dot3x)/1023<br />Osc.dot3y = float(var.dot3y)/767<br />Osc.dot4x = float(var.dot4x)/1023<br />Osc.dot4y = float(var.dot4y)/767<br /><br /><br /><br />// Motion X,Y,Z or Pitch,Roll<br />var.accx = Wiimote.RawAccX<br />var.accy = Wiimote.RawAccY<br />var.accz = Wiimote.RawAccZ<br />var.pitch = Wiimote.Pitch<br />var.roll = Wiimote.Roll<br />var.smoothpitch = Wiimote.SmoothPitch<br />var.smoothrool = Wiimote.SmoothRoll<br />Osc.accx = var.accx<br />Osc.accy = var.accy<br />Osc.accz = var.accz<br /><br />// Osc receive<br />Osc2.ListenPort = 8888<br />Osc2.listening = true<br />var.rumble = Osc2.rumble<br />var.fq = Osc2.fq<br />var.vol = Osc2.vol<br />// Osc receive end<br />// feeback & force<br /> /*<br />if(var.rumble == 1) then<br /> Wiimote.Rumble = true<br /> else<br /> Wiimote.Rumble = false<br />endif<br />*/<br /><br />//Wiimote.Volume = 1<br />//Wiimote.Frequency = var.fq<br />//Wiimote.Rumble = true</span></i></blockquote>
<br />
2. 點選Run,執行程式,同時按住wiimote的1、2鍵,若連線成功,左邊兩顆燈會亮起<br />
<br />
3.Pd寫法如<a href="http://eva54185418.blogspot.tw/2012/07/puredata-workshop-day1joystick-use_03.html" style="background-color: white;">http://eva54185418.blogspot.tw/2012/07/puredata-workshop-day1joystick-use_03.html</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-82744346308204782232012-07-03T09:21:00.003-07:002012-07-03T09:21:52.123-07:00[Puredata] workshop day1_JoyStick use GlovePIE1. GlovePIE<br />
<br />
<ul>
<li><span style="background-color: white;">使用GlovePIE,藉由控制器操作Pd</span></li>
<li><span style="background-color: white;">下載:</span><a href="https://www.dropbox.com/s/m78eq4w05ume6kb/GlovePIE045Free.zip" style="background-color: white;">https://www.dropbox.com/s/m78eq4w05ume6kb/GlovePIE045Free.zip</a></li>
<li>與Pd的hidin差別在於它可抓取上下左右以外的鍵</li>
</ul>
<br />
<br />
2. 解壓縮GlovePIE<br />
<br />
<ul>
<li><span style="background-color: white;">執行PIEFree.exe,若出現d3dx9_33.dll找不到,請下載:</span><a href="https://www.dropbox.com/s/bf1oszv6aha3zmt/d3dx9_33.dll" style="background-color: white;">https://www.dropbox.com/s/bf1oszv6aha3zmt/d3dx9_33.dll</a><span style="background-color: white;">後放到GlovePIE045Free目錄底下重新開啟</span></li>
<li><span style="background-color: white;">在CP-Setting中可以看到各種控制器,在此使用JoyStick</span></li>
<li><span style="background-color: white;">點選JoyStick後,可以確認是否已準確抓到搖桿,內容可確定搖桿操作有無故障</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiykB8tLkCsThyphenhyphenuFk8V1FMSMWk6oqIkEEVBG6AgUAWMcKx3hGkxOw0zmxBlZQ0E4I5Y09zOk1mYnzAxEaBFe69P84TFvyhnunq40Uzj0JHI3y-XRHqAUGg3X8lHSe6S8lOZMP3y58FwOys/s1600/35.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiykB8tLkCsThyphenhyphenuFk8V1FMSMWk6oqIkEEVBG6AgUAWMcKx3hGkxOw0zmxBlZQ0E4I5Y09zOk1mYnzAxEaBFe69P84TFvyhnunq40Uzj0JHI3y-XRHqAUGg3X8lHSe6S8lOZMP3y58FwOys/s1600/35.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT17L8ZbiVpEhhZO_ZFONnnv6llpssL3mkIF8PLfSbWYfvESRKOBHxC2qifWfTekOBEbtQhw1fBsLqVApczD8Tie93wQKj73MVmDZM-l6YDcbcbSiBqAf820mK06WISnXhRkDWGWomnVw/s1600/36.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT17L8ZbiVpEhhZO_ZFONnnv6llpssL3mkIF8PLfSbWYfvESRKOBHxC2qifWfTekOBEbtQhw1fBsLqVApczD8Tie93wQKj73MVmDZM-l6YDcbcbSiBqAf820mK06WISnXhRkDWGWomnVw/s1600/36.PNG" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT17L8ZbiVpEhhZO_ZFONnnv6llpssL3mkIF8PLfSbWYfvESRKOBHxC2qifWfTekOBEbtQhw1fBsLqVApczD8Tie93wQKj73MVmDZM-l6YDcbcbSiBqAf820mK06WISnXhRkDWGWomnVw/s1600/36.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT17L8ZbiVpEhhZO_ZFONnnv6llpssL3mkIF8PLfSbWYfvESRKOBHxC2qifWfTekOBEbtQhw1fBsLqVApczD8Tie93wQKj73MVmDZM-l6YDcbcbSiBqAf820mK06WISnXhRkDWGWomnVw/s1600/36.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT17L8ZbiVpEhhZO_ZFONnnv6llpssL3mkIF8PLfSbWYfvESRKOBHxC2qifWfTekOBEbtQhw1fBsLqVApczD8Tie93wQKj73MVmDZM-l6YDcbcbSiBqAf820mK06WISnXhRkDWGWomnVw/s1600/36.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT17L8ZbiVpEhhZO_ZFONnnv6llpssL3mkIF8PLfSbWYfvESRKOBHxC2qifWfTekOBEbtQhw1fBsLqVApczD8Tie93wQKj73MVmDZM-l6YDcbcbSiBqAf820mK06WISnXhRkDWGWomnVw/s1600/36.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /><br /><br /><br /><div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
3. 撰寫程式碼傳送訊息到OSC</div>
<div>
<ul>
<li><span style="background-color: white;">將程式碼寫在GlovePIE之中,點Run執行</span></li>
</ul>
</div>
<blockquote class="tr_bq">
var.x = joystick.x<br />var.y = joystick.y<br />var.bot1 = joystick.Button1<br />var.bot2 = joystick.Button2<br />var.bot3 = joystick.Button3<br />var.bot4 = joystick.Button4<br />var.bot5 = joystick.Button5<br />var.bot6 = joystick.Button6<br />var.bot7 = joystick.Button7<br />var.bot8 = joystick.Button8<br />var.bot9 = joystick.Button9<br />var.bot10 = joystick.Button10<br />// OSC sen part<br />Osc.ip = "localhost"<br />Osc.port = 7777<br />Osc.x = var.x<br />Osc.y = var.y<br />Osc.bot1 = var.bot1<br />Osc.bot2 = var.bot2<br />Osc.bot3 = var.bot3<br />Osc.bot4 = var.bot4<br />Osc.bot5 = var.bot5<br />Osc.bot6 = var.bot6<br />Osc.bot7 = var.bot7<br />Osc.bot8 = var.bot8<br />Osc.bot9 = var.bot9<br />Osc.bot10 = var.bot10</blockquote>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuu2Km3hcgANCXNgsaaZ-ypPqFUOcn6IAW0lAZNsGrpKTJcikB_hudncBOaEWIAHFycUdaa28lRV_a-u9-gc_m_PHXU0-cbARNVYXyR_rpE338Y05hY7_DLSCwMQjrrG0O_N-nNjlK6ng/s1600/37.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuu2Km3hcgANCXNgsaaZ-ypPqFUOcn6IAW0lAZNsGrpKTJcikB_hudncBOaEWIAHFycUdaa28lRV_a-u9-gc_m_PHXU0-cbARNVYXyR_rpE338Y05hY7_DLSCwMQjrrG0O_N-nNjlK6ng/s1600/37.PNG" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
4. OSC</div>
<div>
<ul>
<li><span style="background-color: white;">勿將GlovePIE關閉開啟Pd</span></li>
<li><span style="background-color: white;">Object,dumpOSC,後面放port的數值</span></li>
<li><span style="background-color: white;">Object,OSCroute,OSC的route,在GlovePIE定義的變數,用route去攫取數值,OSC的route條件前須加上反斜線" / "</span></li>
<li><span style="background-color: white;">比如要抓joystick.x,就使用OSCroute /x,要抓</span><span style="background-color: white;">joystick.Button4,就使用OSCroute /bot4</span></li>
</ul>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbdG43wnJqlMml3en4mF2UvUAQ7dOYck1skSZOrKxRWRMWs7buHZy4vedxJwbM3pvEaFHdm4vFVtnlcMPlsfs_nbSaoqlTrJC6qhFCv2DbPrYqEewr60k1CTFJo_w2n2OYVxISLgqVMKw/s1600/30.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbdG43wnJqlMml3en4mF2UvUAQ7dOYck1skSZOrKxRWRMWs7buHZy4vedxJwbM3pvEaFHdm4vFVtnlcMPlsfs_nbSaoqlTrJC6qhFCv2DbPrYqEewr60k1CTFJo_w2n2OYVxISLgqVMKw/s1600/30.PNG" /></a></div>
<div>
<span style="background-color: white;"><br /></span></div>
<div>
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-3889495382366724142012-07-03T08:50:00.001-07:002012-07-03T09:27:32.268-07:00[Puredata] workshop day1_JoyStick use hidin1.hidin<br />
<br />
<ul>
<li><span style="background-color: white;">hidin是Pd內建的抓取搖桿指令,但只能抓取上、下、左、右</span></li>
<li><span style="background-color: white;">使用message "start",開啟抓取搖桿</span></li>
<li><span style="background-color: white;">使用message "stop",停止抓取搖桿</span></li>
<li><span style="background-color: white;">輸入message "print",在主控台顯示目前搖桿的位置,比如" hidin: ** using device #1: "USB Gamepad " "</span></li>
<li><span style="background-color: white;">輸入message "open 1",開啟hidin,1為搖桿的位置</span></li>
<li><span style="background-color: white;">輸出object "print",在主控台顯示搖桿按鍵按下的數值,比如"上"為"</span><span style="background-color: white;">print: 1 0 跟 </span><span style="background-color: white;">print: 1 127"</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixVLXa0jt4PCg7LXTwehMd81h5p0KfoEGHIHiSjnH7ZSj_-OrHFEmLmWdasOnqAlcM-AQCoXjZUZ8Ob39UglGNmFd-ioMXs9QMFUtcBjUmsXB8erCUyNJG4nEvCz-mxyep4bQO1dLfS6Q/s1600/33.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixVLXa0jt4PCg7LXTwehMd81h5p0KfoEGHIHiSjnH7ZSj_-OrHFEmLmWdasOnqAlcM-AQCoXjZUZ8Ob39UglGNmFd-ioMXs9QMFUtcBjUmsXB8erCUyNJG4nEvCz-mxyep4bQO1dLfS6Q/s1600/33.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUZdTS1G9KVTr0n5MxTFAdZ9zn8WugfcACF3SS2bRSxJzKeH-Lmw2L2uqqOzIjvqoXalNeoSBGUCgcmFZme3wDJAsz-G6TmUP_kAR4GuzgxuzoFKil3RBntUPxnSHvQreNvzMdkYgDU1I/s1600/32.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUZdTS1G9KVTr0n5MxTFAdZ9zn8WugfcACF3SS2bRSxJzKeH-Lmw2L2uqqOzIjvqoXalNeoSBGUCgcmFZme3wDJAsz-G6TmUP_kAR4GuzgxuzoFKil3RBntUPxnSHvQreNvzMdkYgDU1I/s1600/32.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;">2.select與route
</span><br />
<ul>
<li><span style="background-color: white;">按上,</span><span style="background-color: white;">print: 1 0 </span></li>
<li><span style="background-color: white;">按下,</span><span style="background-color: white;">print: 1 255</span></li>
<li><span style="background-color: white;">按左,</span><span style="background-color: white;">print: 2 0 & </span><span style="background-color: white;">print: 3 0 & </span><span style="background-color: white;">print: 4 0 & </span><span style="background-color: white;">print: 5 0</span></li>
<li><span style="background-color: white;">按右,print</span><span style="background-color: white;"> 2 255 & </span><span style="background-color: white;">print: 3 255 & </span><span style="background-color: white;">print: 4 255 & </span><span style="background-color: white;">print: 5 255</span></li>
<li><span style="background-color: white;">從這可知,上跟下為1,左跟右為2 </span></li>
<li><span style="background-color: white;">Object,route,如同過濾器,後方數值為過濾條件,若條件成立,則將message條件後的數值下傳,與select不同點在select只會傳出bang值</span></li>
<li><span style="background-color: white;">因此,使用1跟2作為route條件,select 0跟255</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJaA7snhZCdtPEFDUeUCbVFxwSxlid-G2dcw4rSM7-I6QdTvyKP8ZDYpnFtTtApZU-6rB2mmlSnnc9OHx9F-NlOv74u2f8nEmbuM5MPeB_Mg6TRBW7a96frhTsB1oLFD-5EKnPDNBF3p4/s1600/34.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJaA7snhZCdtPEFDUeUCbVFxwSxlid-G2dcw4rSM7-I6QdTvyKP8ZDYpnFtTtApZU-6rB2mmlSnnc9OHx9F-NlOv74u2f8nEmbuM5MPeB_Mg6TRBW7a96frhTsB1oLFD-5EKnPDNBF3p4/s1600/34.PNG" /></a></div>
<span style="background-color: white;"><br /></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-35076286860385145732012-07-03T01:02:00.001-07:002012-07-03T01:02:48.248-07:00[Puredata] workshop day1_sound1.在Pd中,聲音物件都會有"<span style="color: red;">~</span>"的符號,使用聲音需先將主控台的compute audio勾選起來<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsW1rw89PxeL28E5lW8hGQflvcHhOF7bTeoabWRopGSTB03FaWTu7oS8srEst4CPYHS1Dtq5xdxvnhHRJAS7gMwvlfMzVcIjFHVbAhoJl0RsZdNrTX03lZHEaaS5eWzBpC4ladRDVoFJo/s1600/28.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsW1rw89PxeL28E5lW8hGQflvcHhOF7bTeoabWRopGSTB03FaWTu7oS8srEst4CPYHS1Dtq5xdxvnhHRJAS7gMwvlfMzVcIjFHVbAhoJl0RsZdNrTX03lZHEaaS5eWzBpC4ladRDVoFJo/s1600/28.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
2. osc~<br />
頻率,人能聽到的頻率為20~20000,但一般喇叭無法發出低於50的音頻<br />
<br />
3. dac~<br />
Pd中的喇叭,可輸出聲音,有左右聲道<br />
<br />
4. *~ 1<br />
*~後面的數字為音量,最大為1,可為小數點<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4NCglVMvFgPTQrbTgCHPconFpuIcglMDtoxwmpHRR6r5BOvAOc94QF-hoyVAldV7IxYaEyfYw6P1TVnL26UddCMALHoMjvnbqj3cyS8fYNh8gswg6WUpEk0DDDSPidfkdMJx2XL_hhMY/s1600/29.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4NCglVMvFgPTQrbTgCHPconFpuIcglMDtoxwmpHRR6r5BOvAOc94QF-hoyVAldV7IxYaEyfYw6P1TVnL26UddCMALHoMjvnbqj3cyS8fYNh8gswg6WUpEk0DDDSPidfkdMJx2XL_hhMY/s200/29.PNG" width="187" /></a></div>
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-13497192849093235522012-07-03T00:50:00.000-07:002012-07-03T00:50:37.589-07:00[Puredata] workshop day1_keyboard<span style="background-color: white;">1. key</span><br />
<br />
<ul>
<li><span style="background-color: white;">與gemkeyboard不同的在於,</span><span style="background-color: white;">gemkeyboard只能在gem裡作用,key則是按下鍵盤瞬間即產生</span></li>
<li><span style="background-color: white;">輸出值為數字,對應到不同的鍵盤</span></li>
</ul>
<br />
<br />
2. keyup<br />
<br />
<ul>
<li><span style="background-color: white;">與key不同在於,key為按下去的瞬間,keyup為壓下放開後</span></li>
</ul>
<br />
<br />
3. keyname<br />
<br />
<ul>
<li><span style="background-color: white;">輸出值有兩個,左邊為Number,顯示1或0,1為按下,0為放開。右邊為Symbol(Put/Symbol),動態顯示按下去的鍵</span></li>
</ul>
<br />
<br />
4. 使用select,取得W、S、A、D<br />
<br />
5. 使用t b b<br />
<br />
<ul>
<li><a href="http://eva54185418.blogspot.tw/2010/12/puredata3basic-math-bang-order.html" style="background-color: white;">http://eva54185418.blogspot.tw/2010/12/puredata3basic-math-bang-order.html</a></li>
</ul>
<br />
<br />
6. 建立迴圈,配合鍵盤值<br />
<br />
<ul>
<li><span style="background-color: white;">W、D→ +0.2</span></li>
<li><span style="background-color: white;">A、S→ -0.2</span></li>
</ul>
<br />
<br />
7. Vslider,直向滑軌<br />
<br />
<ul>
<li><span style="background-color: white;">Vslider,Put/Vslider,在Vslider上按右鍵,選取properties</span></li>
<li><span style="background-color: white;">buttom為-4,top為4,即為canvas的最大最小值,改好後選OK</span></li>
<li><span style="background-color: white;">Hslider,用法同</span><span style="background-color: white;">Vslider</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYRjIPCadkezvoF3W1CFIzutegIMjCEjd08vFfOwV9y6WbOwNuqc93mB83I2UXb_7kFPvuhzd5yp1jDfDsmOtYS-Kkf3Ww34ivlovPN2IUmR4wOHNzd4ls_RnEw5S0ZTmDwfERSj1xHr4/s1600/26.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYRjIPCadkezvoF3W1CFIzutegIMjCEjd08vFfOwV9y6WbOwNuqc93mB83I2UXb_7kFPvuhzd5yp1jDfDsmOtYS-Kkf3Ww34ivlovPN2IUmR4wOHNzd4ls_RnEw5S0ZTmDwfERSj1xHr4/s1600/26.PNG" /></a></div>
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
8. 以鍵盤控制圓的位置<br />
<br />
<ul>
<li><span style="background-color: white;">將Vslider的輸出接到Y,Hslider接到X</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdQtHnMk8vfULSDz21IHIUNaO0hAgDL6omxJg728Itbt7gOCx4_CYJ50X5EBi5T1trpU0ZgLiNuhnW5EYQqQBTrTgg9khfJ5uUVgqVjZY3CSRNL7Qa6OK_sHDx8J9_hKLhQDR3XHqyAN4/s1600/27.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdQtHnMk8vfULSDz21IHIUNaO0hAgDL6omxJg728Itbt7gOCx4_CYJ50X5EBi5T1trpU0ZgLiNuhnW5EYQqQBTrTgg9khfJ5uUVgqVjZY3CSRNL7Qa6OK_sHDx8J9_hKLhQDR3XHqyAN4/s1600/27.PNG" /></a></div>
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-55120617974303936932012-07-03T00:04:00.000-07:002012-07-03T00:12:35.819-07:00[Puredata] workshop day1_gemkeyboard1. 使用鍵盤操作畫面中的物體<br />
Object,gemkeyboard,輸出值為數字,分別對應不同的鍵盤,此指令只可在gem視窗內使用<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirnx0JKcA4amzmbWbN5vnyPKStgpXYleH35pGvddWSUel6tw9f_eN0PkcGY9dGUh8qfhOR1PooMB6hzJbb3ueVfIVya6AneUcTmbCNgOQoGn-sOXSj-AjwJb6BF2KcqcTR9cN4ccbpJSE/s1600/24.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirnx0JKcA4amzmbWbN5vnyPKStgpXYleH35pGvddWSUel6tw9f_eN0PkcGY9dGUh8qfhOR1PooMB6hzJbb3ueVfIVya6AneUcTmbCNgOQoGn-sOXSj-AjwJb6BF2KcqcTR9cN4ccbpJSE/s1600/24.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
2. 使用select,區別不同鍵盤</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li><span style="background-color: white;">Object,sel,後面輸入數字,比如</span><b style="background-color: white;">sel 1 2</b><span style="background-color: white;">,當輸入值為1或2,就會往下傳,下方會產生三個輸出值,從左開始為,輸入值為1、</span><span style="background-color: white;">輸入值為2、輸入值非前面出現的選項</span></li>
<li><span style="background-color: white;">若要使用鍵盤上下左右控制,即可使用</span><span style="background-color: white;"><b>sel 38 40 37 39</b></span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
3. 使用unpack</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li><span style="background-color: white;">利用上下左右鍵控制物體位置,使用message輸入X、Y的位置,比如1 3,數字間要空格</span></li>
<li><span style="background-color: white;">Object,unpack,unpack可將1 3分別輸出1、3,f為浮點數</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje3FDevyAOPOZrrEDrFcPSEIDMIZmtnaZ6q2F4GhzpwkO8xr6zwd6EZ0Xeybk7emCQXAmU0Eg1iuXjgkQiIXrbd4IiNJixoOjoHLLClhxbYV7S6FHOkgze0CGI5-hQiEQihs9btSacisg/s1600/25.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje3FDevyAOPOZrrEDrFcPSEIDMIZmtnaZ6q2F4GhzpwkO8xr6zwd6EZ0Xeybk7emCQXAmU0Eg1iuXjgkQiIXrbd4IiNJixoOjoHLLClhxbYV7S6FHOkgze0CGI5-hQiEQihs9btSacisg/s1600/25.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-78370119330647049032012-07-02T23:44:00.000-07:002012-07-02T23:45:16.513-07:00[Puredata] workshop day1_color1. 使用color改變背景顏色<br />
<br />
<ul>
<li><span style="background-color: white;">Message,color,後三個數字為RGB,範圍0~1,0為黑色,1為白色</span></li>
<li><span style="background-color: white;">將color連到gemwin上即可變換顏色</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4OS_0x_a0M1RNx9J_0UpPSqv5PDb1qqz5widzfkLQKp1cX20JMq1uXq7mecTPtHVBgBFIVBDBSUvlw4s2ReyBL9gtHQUKv4fThi_tjt9RKpyVQetKBoOEXpuiSiQy0T1khK6CQUPkTZ8/s1600/20.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4OS_0x_a0M1RNx9J_0UpPSqv5PDb1qqz5widzfkLQKp1cX20JMq1uXq7mecTPtHVBgBFIVBDBSUvlw4s2ReyBL9gtHQUKv4fThi_tjt9RKpyVQetKBoOEXpuiSiQy0T1khK6CQUPkTZ8/s1600/20.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
2. 運用變數,動態改變背景顏色<br />
<br />
<ul>
<li><span style="background-color: white;">運用迴圈產生0~1的數值,使用0~100的迴圈再除以100,可取得0~1的小數點,單位是0.01</span></li>
<li><span style="background-color: white;">在Pd中,變數使用</span><span style="background-color: white; color: red;"><b>$</b></span><span style="background-color: white;">,比如</span><span style="background-color: white;">變數1→$1,</span><span style="background-color: white;">變數2→$2,</span><span style="background-color: white;">x+y=5 → </span><span style="background-color: white;">$1+$2=5</span></li>
<li><span style="background-color: white;">在color中的R中使用$1,便可利用迴圈產生的數值動態改變R值</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB6ppFtnAsMtb33IQhv6cIuFqF0EqUwFAXWGfa8bHIjRUC-887XazDm1h6pKybkLyGiWo3lF67Au3eFf-UeaoveFWmuuKN7heLWfluy2jCgAEJ3h2vR1tIzcuzAYEkeCBPQbe2y89xfsI/s1600/21.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB6ppFtnAsMtb33IQhv6cIuFqF0EqUwFAXWGfa8bHIjRUC-887XazDm1h6pKybkLyGiWo3lF67Au3eFf-UeaoveFWmuuKN7heLWfluy2jCgAEJ3h2vR1tIzcuzAYEkeCBPQbe2y89xfsI/s1600/21.PNG" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghnQzCfEE3sUorlEnoWf9ZbPDQAcAcKAzL_2lE-HpltoLa-ubREaw1PngiV3TDHVHoAVaQfi_sfoEqMjvLbwo-jpcIp0ejRQL8mTSt5yMHrdlS6DAueyAvBuhBT93ACrdMUEvNXiejvy8/s1600/22.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghnQzCfEE3sUorlEnoWf9ZbPDQAcAcKAzL_2lE-HpltoLa-ubREaw1PngiV3TDHVHoAVaQfi_sfoEqMjvLbwo-jpcIp0ejRQL8mTSt5yMHrdlS6DAueyAvBuhBT93ACrdMUEvNXiejvy8/s1600/22.PNG" /></a></div>
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<div>
<br /></div>
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-3407285586551464472012-07-02T23:08:00.001-07:002012-07-02T23:09:09.076-07:00[Puredata] workshop day1_loop1. 迴圈,不斷重複執行動作<br />
<br />
<ul>
<li><span style="background-color: white;">Bang,Put/Bang,放置一個物件,點擊即執行</span></li>
<li><span style="background-color: white;">Object,f 1,f為float,此物件為1 的浮點數</span></li>
<li><span style="background-color: white;">數值+ 1後,送回 f 繼續累加</span></li>
<li><span style="background-color: white;">若要取某範圍內的數字不斷重複,需使用%取餘數,比如取10的餘數,% 10,即是不斷重複0~9</span></li>
<li><span style="background-color: white;">在執行模式下,點擊bang,以下的數值便會不斷累加</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaeYffgM0VXSFCyDKBzmIJmWEJHlrtxSv8YVguo9qBPI1mlG0wYxlEb5eFbe9eSSUg0GsGGJGHh8JfNe0fV4Y5Hq2bc0OQ4HsiYjcOWxKHS4rQXUoj6EIZvTKfLDbdy4y94WqvX6_OcEE/s1600/17.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaeYffgM0VXSFCyDKBzmIJmWEJHlrtxSv8YVguo9qBPI1mlG0wYxlEb5eFbe9eSSUg0GsGGJGHh8JfNe0fV4Y5Hq2bc0OQ4HsiYjcOWxKHS4rQXUoj6EIZvTKfLDbdy4y94WqvX6_OcEE/s1600/17.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
2. 使用metro自動執行迴圈</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li><span style="background-color: white;">Object,metro,後方數值為毫秒數,意指每毫秒執行一次,右方輸入端可動態輸入毫秒數</span></li>
<li><span style="background-color: white;">Toggle,Put/Toggle,開關,與metro搭配使用,點擊可開關,開啟時顯示X,關閉時顯示空白方格</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC_ApVez9gDghUv02ok_XBB7ERrmsAKIYoDnu2wqWE6Buta8XXZxBA_9Jrd9YBNuBnkqpY7D9woXIq_kGy1Y1gNFKaBV6CkJxUQO3i2hmpAcmWp2r7tuhHxW6W1mMwbpXs4AdyPEk-LbM/s1600/18.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC_ApVez9gDghUv02ok_XBB7ERrmsAKIYoDnu2wqWE6Buta8XXZxBA_9Jrd9YBNuBnkqpY7D9woXIq_kGy1Y1gNFKaBV6CkJxUQO3i2hmpAcmWp2r7tuhHxW6W1mMwbpXs4AdyPEk-LbM/s1600/18.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-34600049551158052432012-07-02T22:46:00.003-07:002012-07-02T22:47:11.439-07:00[Puredata] workshop day1_translate1. 使用translate改變circle的位置<br />
<br />
<ul>
<li><span style="background-color: white;">在gemhead跟中間加入translateXYZ,translateXYZ上方會有四個輸入端,左至右分別為觸發、X軸、Y軸、Z軸</span></li>
<li><span style="background-color: white;">若無輸入數值,預設值為(0,0,0),也可靜態輸入預設值,值與值之間需有空白格,如translateXYZ 1 2 1,位置便為(1,2,1)</span></li>
<li><span style="background-color: white;">使用Number便可動態變化位置</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn9czywCHApxDTlFvhpDWGr628aerhoaJvTHfZQh7B1ybi43ffTvo5QnvfruDWFjnv9Iczu-3nOQuUXfuEdrTv3HDO_bAG1zi9CRdyA2Vx5ykoJ8pY7fW2Hmv5n7gznGvepxytJ1cUcvU/s1600/13.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn9czywCHApxDTlFvhpDWGr628aerhoaJvTHfZQh7B1ybi43ffTvo5QnvfruDWFjnv9Iczu-3nOQuUXfuEdrTv3HDO_bAG1zi9CRdyA2Vx5ykoJ8pY7fW2Hmv5n7gznGvepxytJ1cUcvU/s1600/13.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
2. 取得滑鼠位置</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li><span style="background-color: white;">Object,gemmouse,抓取滑鼠位置</span></li>
<li><span style="background-color: white;">gemmouse 1 2,將滑鼠抓取的x位置轉換為0~1,</span><span style="background-color: white;">將滑鼠抓取的x位置轉換為0~2</span></li>
<li><span style="background-color: white;">gemmouse有五個輸出,由左至右為,X位置、Y位置、滑鼠左鍵是否按下、滑鼠中鍵</span><span style="background-color: white;">是否按下</span><span style="background-color: white;">、滑鼠右鍵</span><span style="background-color: white;">是否按下</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1O108rAN9DEKL82kKJN55cALxyG-2KjzqsJMe2S8Ya9hdg-dhra1qBYjuNmoVGyrA95qxmlkroy_ccvKplm2PcvbII0euBwlu04gfJL7tFTqtbHP69LbhwIQaXKNhFYaDlHly77pt4Lc/s1600/15.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1O108rAN9DEKL82kKJN55cALxyG-2KjzqsJMe2S8Ya9hdg-dhra1qBYjuNmoVGyrA95qxmlkroy_ccvKplm2PcvbII0euBwlu04gfJL7tFTqtbHP69LbhwIQaXKNhFYaDlHly77pt4Lc/s1600/15.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
3. 使用滑鼠位置改變circle位置</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li><span style="background-color: white;">由於畫面最大最小值是由 4 ~ -4,因此需將gemmouse取得的值改為 4 ~ -4</span></li>
<li><span style="background-color: white;">Object,range,將數值縮放,range 0 1 4 -4,把0~1的數值,縮放到</span><span style="background-color: white;"> </span><span style="background-color: white;">4 ~ -4</span></li>
<li><span style="background-color: white;">gemmouse第一個、第二個輸出端,透過range,接到translateXYZ的X、Y中</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRV2ZMlBdC0PtXrmcB9a2wQEh6_HaMaZQdP730oGeEWYFMMHj1911RL5NhHgutchnfiiy6l7spEINPi3MgTPNWEfMP-YfmNwGKX0IKNj2hnMpM7m1i-vgbqGkSdxQHPErVh5kiaiBjXsM/s1600/16.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRV2ZMlBdC0PtXrmcB9a2wQEh6_HaMaZQdP730oGeEWYFMMHj1911RL5NhHgutchnfiiy6l7spEINPi3MgTPNWEfMP-YfmNwGKX0IKNj2hnMpM7m1i-vgbqGkSdxQHPErVh5kiaiBjXsM/s1600/16.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="background-color: white;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-67502702467706422112012-07-02T21:56:00.003-07:002012-07-02T21:57:06.586-07:00[Puredata] workshop day1_gem使用Puredata畫圖<br />
<br />
1. 建立畫布<br />
<br />
<ul>
<li><span style="background-color: white;">使用Object,輸入</span><b style="background-color: white;">gemwin</b><span style="background-color: white;">,gemwin就是畫圖的方式,可以想像成主機</span></li>
<li><span style="background-color: white;">使用Message,輸入</span><b style="background-color: white;">create,1</b><span style="background-color: white;">,當Message裡使用到逗號,便是傳出一個以上的訊息,比如1,43,65就是三個訊息,create是建立畫布,1就是開始算圖,想像成有了主機,若需使用仍要開機才可</span></li>
<li><span style="background-color: white;">使用Message,輸入</span><b style="background-color: white;">destroy</b><span style="background-color: white;">,destroy為刪除畫布</span></li>
<li><span style="background-color: white;">將create,1與destroy連結到gemwin</span></li>
<li><span style="background-color: white;">開啟執行模式點選create即可建立,點選destory即可銷毀</span></li>
<li><span style="color: red;">畫布最左方為 -4,最右方為 4,最上方為 4,最下方為 -4</span> </li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ7w25BUNPkIdq1_nJ7-WSbwHg4yaitFxSOVsvoRALqdPxyo8lQuTweQ8C5vHl6AD7MaWTK5AeA-_Dj4mSkCIWqpkmn03EnQ_ruf7BNWfmh1iSMPsgjo6eje6MGk6fpDix1DBecVqAgIY/s1600/07.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ7w25BUNPkIdq1_nJ7-WSbwHg4yaitFxSOVsvoRALqdPxyo8lQuTweQ8C5vHl6AD7MaWTK5AeA-_Dj4mSkCIWqpkmn03EnQ_ruf7BNWfmh1iSMPsgjo6eje6MGk6fpDix1DBecVqAgIY/s1600/07.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwlJZ3rsopATDxdvvNorKI5Rugtlmbc5zi_gT2f604w-I7AumJqIxJmxmXTyltcYtJhIcUFXjmquZdyfFabMo2FNblQTodnEGoX12ecV4wQH2RKbK6Z9pFtNFizTcGiCDV62vpptP98xQ/s1600/08.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwlJZ3rsopATDxdvvNorKI5Rugtlmbc5zi_gT2f604w-I7AumJqIxJmxmXTyltcYtJhIcUFXjmquZdyfFabMo2FNblQTodnEGoX12ecV4wQH2RKbK6Z9pFtNFizTcGiCDV62vpptP98xQ/s1600/08.PNG" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
2. 畫圓形<br />
<br />
<br />
<ul>
<li><span style="background-color: white;">使用Object,輸入</span><b style="background-color: white;">gemhead</b><span style="background-color: white;">,一個演員需要表演需要舞台,而gemhead就是一個舞台</span></li>
<li><span style="background-color: white;">使用Object,輸入</span><b style="background-color: white;">circle</b><span style="background-color: white;">,此指令可畫圓,預設半徑為1,也可自行輸入半徑,比如要半徑2的圓形,即輸入</span><b style="background-color: white;">circle 2</b><span style="background-color: white;">,circle與2中間需有空白格</span></li>
<li><span style="background-color: white;">circle上方有兩輸入端,左為執行,右為半徑</span></li>
</ul>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPRT_YtfJk7UEyAoKkUOkjKfgI1QnATvLxrmajFyw50nqVs2eFNujl8QjbjbmwodNyCMtvUaVxRjp_J2_oRHRZwGNHdNCkF-zubQJsckKcfSu7IPFZbZuI3uEpo0WIIdd0S2CurhkbCtw/s1600/10.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPRT_YtfJk7UEyAoKkUOkjKfgI1QnATvLxrmajFyw50nqVs2eFNujl8QjbjbmwodNyCMtvUaVxRjp_J2_oRHRZwGNHdNCkF-zubQJsckKcfSu7IPFZbZuI3uEpo0WIIdd0S2CurhkbCtw/s1600/10.PNG" /></a></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXndLpaLh4urRX5mEfufZsqAD3rM54ix_TcQprTXjyWjqFYny56okvuwznNi56g_RGoTEn1KsPCRT8lHAXFKsvQ-voyibMihXNOqRTvanisRBwuHDHD09920JO0R8crqoFeQtXkduqwhI/s1600/09.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXndLpaLh4urRX5mEfufZsqAD3rM54ix_TcQprTXjyWjqFYny56okvuwznNi56g_RGoTEn1KsPCRT8lHAXFKsvQ-voyibMihXNOqRTvanisRBwuHDHD09920JO0R8crqoFeQtXkduqwhI/s1600/09.PNG" /></a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
3. 動態改變圓形半徑<br />
<br />
<br />
<ul>
<li><span style="background-color: white;">使用Number,並將Number連結到circle</span></li>
</ul>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB5lvDQ5t4qtx9hjhPuWJsv2WdzBhUI1K_FAVvzOZ9ycLWxyIvb8TGiXKvk3DVcLmHT-hctW-FKWLZbPtfHY9GXME-Z-QaB3QGrB1GbS10hHezwsX-3kzoT8g6tHcj0PV7US39cRi9BU4/s1600/11.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB5lvDQ5t4qtx9hjhPuWJsv2WdzBhUI1K_FAVvzOZ9ycLWxyIvb8TGiXKvk3DVcLmHT-hctW-FKWLZbPtfHY9GXME-Z-QaB3QGrB1GbS10hHezwsX-3kzoT8g6tHcj0PV7US39cRi9BU4/s1600/11.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
4. 利用麥克風聲音改變圓形半徑</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li><span style="background-color: white;">Object,adc~,接收麥克風的值</span></li>
<li><span style="background-color: white;">Object,env~,將接收到的值輸出為0~100</span></li>
<li><span style="background-color: white;">將麥克風取得的值,除以40,放入circle的半徑中,使之動態變化</span></li>
</ul>
<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqoEn3cQqCkfB3TydQ-b2sMAEbrn1Owc3ASGprZ_-KWs-1ZsT6UgFD-vjMqMqQleNMqTTERZT6kocLmRff8AVAEBRfUE6J1LEDnH08A0ef1c4UzOGxBt96RrzVchn-MtxiyTMOQVP-5Fc/s1600/12.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqoEn3cQqCkfB3TydQ-b2sMAEbrn1Owc3ASGprZ_-KWs-1ZsT6UgFD-vjMqMqQleNMqTTERZT6kocLmRff8AVAEBRfUE6J1LEDnH08A0ef1c4UzOGxBt96RrzVchn-MtxiyTMOQVP-5Fc/s1600/12.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-78727215507333537032012-07-02T20:32:00.001-07:002012-07-02T20:32:16.390-07:00[Puredata] workshop day1_hello world<div>
簡單介紹:</div>
Pd (全名 Pure Data)是一個即時圖形化編寫程式環境,針對音頻,視頻和圖形處理。<div class="separator" style="clear: both; text-align: center;">
<a href="http://en.flossmanuals.net/pure-data/ch040_wireless-connections/_booki/pure-data/static/PureData-DataFlow-sendreceive1-en.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="265" src="http://en.flossmanuals.net/pure-data/ch040_wireless-connections/_booki/pure-data/static/PureData-DataFlow-sendreceive1-en.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
======================================================================</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
1. 開啟Pd後會出現<span style="background-color: white;">console window(主控台,顯示偵錯狀態)</span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp-lzQEZvH1eJGcFgpKUJfTS3QOd19WqhES8FewUbSgspdozvgR9bNtbn_IDCSJfX4S6PNZzpjWVG-B-kV8hu0t6mKfztYY6n-fOOHQYnVuUsx263CrGga549QRTt0ClvfnkwE9v82TKw/s1600/01.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="251" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp-lzQEZvH1eJGcFgpKUJfTS3QOd19WqhES8FewUbSgspdozvgR9bNtbn_IDCSJfX4S6PNZzpjWVG-B-kV8hu0t6mKfztYY6n-fOOHQYnVuUsx263CrGga549QRTt0ClvfnkwE9v82TKw/s320/01.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
2. 開啟新檔案,選擇console window上方的File,選擇New。</div>
<div class="separator" style="clear: both; text-align: left;">
請勿將新開視窗放大到無法看到console window,以方便隨時檢查狀態。</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7rCntFu7gNPWxVm7Rp-GPdp6jd_by0mFcxs2O29Tce2x6Q7NON_doVmYLg6XZ9c1o27-wbkMdgFJg46WnzbU7Z-Ko5g9HLUbcm4K5vCzfYfcRLiIKP_LqiovjibR_FP3T2bRQMBWRJLk/s1600/02.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="245" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7rCntFu7gNPWxVm7Rp-GPdp6jd_by0mFcxs2O29Tce2x6Q7NON_doVmYLg6XZ9c1o27-wbkMdgFJg46WnzbU7Z-Ko5g9HLUbcm4K5vCzfYfcRLiIKP_LqiovjibR_FP3T2bRQMBWRJLk/s320/02.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="background-color: white;">3. Pd有兩種模式,編輯模式與執行模式</span></div>
<div class="separator" style="clear: both; text-align: left;">
編輯模式:滑鼠游標為手掌形狀</div>
<div class="separator" style="clear: both; text-align: left;">
執行模式:滑鼠游標為箭頭形狀</div>
<div class="separator" style="clear: both; text-align: left;">
切換方式:Edit / edit mode</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: left;">
4. 第一支小程式,Hellow world</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
切換至編輯模式</div>
<div class="separator" style="clear: both; text-align: left;">
新增Object:Put/Object,Object為產生一行為</div>
<div class="separator" style="clear: both; text-align: left;">
Object內打入print,若輸入錯誤邊框會出現紅線</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
新增Message,Message為送出參數</div>
<div class="separator" style="clear: both; text-align: left;">
Message內打入文字,Pd目前只接受英文</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiNbPXXzYDmakoCqU0BDpC82j3bFMrE9Lf0F42MeZSzvj2n6YhyxWjwer2EPzQE_OBVBgC3xVR91-zd_Qy3LjKfr0e_d0oV1bsvPqxQYxtPFwMLtHvs4wDjLK-HEdkvye8aa2T-ZOalP4/s1600/03.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiNbPXXzYDmakoCqU0BDpC82j3bFMrE9Lf0F42MeZSzvj2n6YhyxWjwer2EPzQE_OBVBgC3xVR91-zd_Qy3LjKfr0e_d0oV1bsvPqxQYxtPFwMLtHvs4wDjLK-HEdkvye8aa2T-ZOalP4/s1600/03.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
5. Pd物件的上方均為輸入端,下方為輸出端</div>
<div class="separator" style="clear: both; text-align: left;">
將Message的輸出端接到print的輸入端</div>
<div class="separator" style="clear: both; text-align: left;">
切換到執行模式點選hello world</div>
<div class="separator" style="clear: both; text-align: left;">
即可在console window看到hello world</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpoeJaayi-FbTG-yNyKd3CNIumB-q8XlW2Qgm955r_QcLVoiBu8VuZVNVFNGJySocR8_BLDelwC-b-P_mpiKdEkuJKsNp0yOv0LYZWOsAkBXB9330SMmUeCQXYRvntDuuxNpG6bl9fIow/s1600/04.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpoeJaayi-FbTG-yNyKd3CNIumB-q8XlW2Qgm955r_QcLVoiBu8VuZVNVFNGJySocR8_BLDelwC-b-P_mpiKdEkuJKsNp0yOv0LYZWOsAkBXB9330SMmUeCQXYRvntDuuxNpG6bl9fIow/s1600/04.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6xgbUb_Emco4gY9EtYmXIftGvg4r3n1sdWVDNaXhvI2RjNYmcyufr50xZDw-Vy7XD4N5HHtmk2e1P3BSaBPbMjH2zbvCEtjkh1ZiTYvoytSvew8XpTmZNPbnKsyo4aqinEQ3_f6yAITs/s1600/05.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6xgbUb_Emco4gY9EtYmXIftGvg4r3n1sdWVDNaXhvI2RjNYmcyufr50xZDw-Vy7XD4N5HHtmk2e1P3BSaBPbMjH2zbvCEtjkh1ZiTYvoytSvew8XpTmZNPbnKsyo4aqinEQ3_f6yAITs/s1600/05.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
6. Message為靜態輸入,若要使用動態輸入,需使用Number,File / Number</div>
<div class="separator" style="clear: both; text-align: left;">
切換到執行模式,以左鍵持續按著Number上下拖曳即可改變數值,並不斷地在console window顯示</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggHByQGgxpp4PTM-iUPOzrA-tRIUg3BG73hSGXfeD3hK1QUIW9SutuaTJRr9mr-H1TU7tNOw0Wh9TJ5I8_AxJPkkD1C92piHsVAuiDNjt7_v77COsV9sUsW9gAkXj6lDibHTgS-mwaC58/s1600/06.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggHByQGgxpp4PTM-iUPOzrA-tRIUg3BG73hSGXfeD3hK1QUIW9SutuaTJRr9mr-H1TU7tNOw0Wh9TJ5I8_AxJPkkD1C92piHsVAuiDNjt7_v77COsV9sUsW9gAkXj6lDibHTgS-mwaC58/s1600/06.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="text-align: center;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="text-align: center;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-66794568853973401342012-06-13T22:46:00.000-07:002012-06-13T22:46:11.286-07:00[Processing] C:\processing-1.2.1\libraries\JMyron\library\JMyron.dll: Can't find dependent libraries<br />
<div style="font-family: Arial, Verdana, sans-serif; font-size: 13px;">
節錄自: <a href="http://projectsentrygun.rudolphlabs.com/make-your-own/setting-up-the-software">http://projectsentrygun.rudolphlabs.com/make-your-own/setting-up-the-software</a></div>
<div style="font-family: Arial, Verdana, sans-serif; font-size: 13px;">
<strong><br /></strong></div>
<div style="font-family: Arial, Verdana, sans-serif; font-size: 13px;">
<strong>A tip for Windows 7 users, from lgfa321:<br /></strong>If you are getting this error when you try to run: processing.app.debug.RunnerException: UnsatisfiedLinkError: D:\Software\processing-1.2.1\libraries\JMyron\library\JMyron.dll: Can't find dependent libraries:<br /><br />"<strong>Reason</strong> : Windows 7 doesn't come with MicroSoft C libraries, which were normally include in the other (older) Windoes system.<br />This means there are two files missing in the Windows 7 system: MSVCP71.DLL and Msvcr71.dll<br /><strong>Solution</strong> : Download these two files from here:<br /><a href="http://www.addictivetips.com/?attachment_id=38105" style="outline-style: none;">http://www.addictivetips.com/?attachment_id=38105</a><br />AND!<br />For Windows 7 32-bit OS: put both dll files inside Windows/System32 folder<br />For Windows 7 64-bit OS: put both dll files inside Windows/SysWOW64 folder."</div>
<div style="font-family: Arial, Verdana, sans-serif; font-size: 13px;">
<br /></div>
<div style="font-family: Arial, Verdana, sans-serif; font-size: 13px;">
<br /></div>
<div style="font-family: Arial, Verdana, sans-serif; font-size: 13px;">
<br /></div>
<div style="font-family: Arial, Verdana, sans-serif; font-size: 13px;">
<b>Setup Instructions for OSX 10.7 Lion (from AaronW):</b></div>
<ol style="font-family: Arial, Verdana, sans-serif; font-size: 13px;">
<li>Unzip and Install the Arduino IDE v1.0 for OSX into your applications folder.</li>
<li>Unzip and Install the Processing IDE v1.5.1 for OSX into your applications folder.</li>
<li>Run the Arduino IDE,( I was prompted to automatically download and install a Java runtime as this was run on a clean install of OSX).</li>
<li>Run the Processing IDE, and close it again.</li>
<li>Check that there is now an “arduino” and “processing” folder in your user “Documents” folder</li>
<li>Download Code Version 6.02.zip from the Project Sentry Gun Website.</li>
<li>Extract the zip file and open “Code Version 6.02.zip/Arduino Code/Turrett_06_02/Turret_06_02.ino”,in the Arduino IDE, upload to your Arduino controller.</li>
<li>Copy the “Code Version 6.02.zip/Processing code/libraries” folder to your user “Documents /Processing” folder.</li>
<li>Download libJMyron.jnilib compiled for intel macs from <a href="http://jibberia.com/projects" style="outline-style: none;">http://jibberia.com/projects</a> and use it to replace the libJMyron.jnilib currently located in your user “Documents/Processing/libraries/JMyron/library” folder.</li>
<li>Run the Processing IDE and load “Code Version 6.02.zip/Processing code/Turrret_06_02/Turret_06_02.pde”.</li>
<li>Click Run.</li>
</ol>
<br class="Apple-interchange-newline" />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-17794042611116403192012-04-22T10:03:00.001-07:002012-04-22T10:03:33.336-07:00[Processing] couldn t find any capture devices使用processing來執行webcam時<br />
若是遇到couldn t find any capture devices的error<br />
可能是因為下列原因(擷取網路)<br />
<span style="background-color: #e2e2e2; font-family: Verdana, Helvetica, Arial; font-size: 12px; text-align: -webkit-left;">If you are not using an Apple computer, you will also need a VDIG, a video driver that translates from your hardware to the video functions used by QuickTime. This software may be included in the software provided by the maker of your hardware, or you can download the free VDIG available</span>
<br />
<div style="text-align: -webkit-left;">
<span style="font-family: Verdana, Helvetica, Arial;"><span style="font-size: 12px;"><br /></span></span></div>
<div style="text-align: -webkit-auto;">
此時安裝WinVDIG_101.exe即可解決</div>
<div style="text-align: -webkit-auto;">
<span style="background-color: white; font-family: Verdana; font-size: 12px; text-align: -webkit-left;"><a href="http://www.shiffman.net/vdig/WinVDIG_101.exe">http://www.shiffman.net/vdig/WinVDIG_101.exe</a></span></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6555513058807453382.post-52767797753051084102012-04-11T23:05:00.000-07:002012-04-11T23:05:59.415-07:00[Artist] Stefanie Wuschitz官方網站:<a href="http://grenzartikel.com/">http://grenzartikel.com/</a>
<br />
VIMEO:<a href="https://vimeo.com/user585475">https://vimeo.com/user585475</a>
<br />
女性實驗室:<a href="http://www.mzbaltazarslaboratory.org/blogDE/">http://www.mzbaltazarslaboratory.org/blogDE/</a><br />
<br />
思考如何改變並掌握自己的人生<br />
可從科技、經濟、政治著手,但這些大部分掌握在男性手中<br />
於是 Stefanie Wuschitz決定自己開始學習關於科技的部分<br />
<br />
<br />Unknownnoreply@blogger.com0