發表文章

目前顯示的是 2009的文章

然後讀了:Commentary on a post about Adobe’s “Mobile Strategy”

從這篇認識了一些Flashlite的發展歷程 "In the end, Adobe isn’t really providing any clear direction on what Flash professionals should be doing/taking on devices, other than waiting for 10.1 and Adobe CS5 these days. Hopefully, that’ll change in 2010 as 10.1 starts to appear." 連這位專家也對FP10.1感到困惑。 "Android would only make sense, if Adobe *wasn’t* going to do AIR on Android devices … to my knowledge, they haven’t really disclosed that info one way or the other." Flash to iPhone模式要發生在其他平台的一個要素是, 除非對方平台不願給放AIR,不然這個模式沒太大意義。 參考來源: "Commentary on a post about Adobe’s “Mobile Strategy”" - Scott Janousek » Blog Archive » Commentary on a post about Adobe’s “Mobile Strategy” ( 在「Google 網頁註解」中檢視 )

看了文章:Why Adobe’s mobile strategy is fundamentally flawed

讀後感,順便測試一下Google的「網頁註解」 這個題目還不錯, 但作者最後的結論竟然是希望Adobe應該想辦法讓Flash Developer有辦法產出Native apps....如果覺得Flash VM on Mobile造成crapy UE的話,那理所當然要要求Adobe改善crapy VM這件事,Adobe現在好像也是在做這件事。 不是很了解為什麼作者覺得VM不夠好, 轉而認為應該保有Flash CS,放棄VM??。FP10.1不只是FP而已,10. 1這次更新的重點也是為了解決crapy FlashLite的問題不是嗎? 但這篇文章還是讓我知道大家(包括後來回應的Scott Janousek) 對FP 10.1下一步的動作都還是很迷惘 參考來源: Aral Balkan · Why Adobe’s mobile strategy is fundamentally flawed ( 在「Google 網頁註解」中檢視 )

3dmax的biped如何使用CMU的免費motion capture資源

圖片
使用3dmax方面我是外行人,在此以外行人的角度紀錄一下這個操作步驟,有用語錯誤之處請指教。 謝天謝地CMU分享了2600多筆免費的人物動態資料:  CMU Graphics Lab Motion Capture Database This data is free for use in research projects. You may include this data in commercially-sold products, but you may not resell this data directly, even in converted form.There are  2605  trials in  6  categories and  23  subcategories. 分享的格式主要是: tvd, c3d, amc 但這些格式3dmax都不直接支援,因此要使用的話必須使用轉檔工具 Amc2Bvh轉成bvh格式使用,不過其實也可以不用那麼辛苦,因為很幸運地已經有大師幫我們把格式全部都轉成bvh了。 Amc2Bvh provides batch conversion from ASF/AMC to BVH, which are two popular formats used in many motion capture and character animation applications such as  Blender  and  Poser . 這個轉檔工具我實際使用時轉檔都失敗-_- 。 最後當取得bvh檔時,還需要一些操作再把bvh轉成bip格式。 因為匯入motion caputre檔案的時候,bvh似乎會一起改變骨架(figure)的位置和大小,這樣就會讓我們自己的骨架變了型,所以不能直接把3dmax所支援的bvh套用到我們腳色的figure上,所以我們中間還需要一個步驟就是先把bvh的動作套用到一個biped上,然後用這個biped的工具把動作輸出成.bip檔,最後再用我們的骨架把.bip讀進來,就成了。 轉換過程操作如下: (1) 首先要先把bvh匯入到3dmax 首先自行建立一個biped物件 --> motion tab --> Motion Capt

如何由被讀取的swf (loadee)呼叫讀取者(loader)的function

想呼叫到loader的function,關鍵就是要能夠從被讀取者access到讀取者。範例如下: loader.swf中: trace("loader started."); var loader:Loader = new Loader(); addChild(loader); loader.load(new URLRequest("loadee.swf")); function loaderMethod():void { trace('hello!'); } // pose loader loader.x = stage.stageWidth/2; loader.y = stage.stageHeight/2; loadee.swf中: trace("loadee started."); // 呼叫最parent物件的方法 MovieClip(stage.getChildAt(0)).poppaMethod(); // 呼叫loader所在的物件的方法 (loaderInfo.loader.parent as MovieClip).poppaMethod(); 如果被讀取者想確認是否被讀取,確認讀取以後才去呼叫loader的方法,可以在loadee.swf加上: this.addEventListener(Event.ADDED_TO_STAGE, callLoaderMethod); function callLoaderMethod(event:Event):void { (loaderInfo.loader.parent as MovieClip). loaderMethod(); }

使用avi影片作為ARToolkit的視訊輸入源

在ARToolkit中,讀取video configuration的語法為: arVideoOpen( vconf ); 在範例中都可以看到 vconf 所指向的xml內容,預設是以camera作為影像輸入源,如果要改用avi格式的影像來做辨識,只要把xml內容的<camera>標籤改為如下的<avi_file>標籤即可。     <avi_file file_name="Data/hiro_pattern640x480.avi" loopAVI="true">         <pixel_format>             <RGB32 flip_h="false" flip_v="true"/>         </pixel_format>     </avi_file> avi的路徑是以exe檔為相對位置,不是以xml為相對位置。

如何把3dmax的physique轉成skin

圖片
使用3dmax的physique開發的骨架動畫不被大部分的動態3d格式輸出工具(*.b3d, *.3ds, ... exporter)所支援,大部分輸出工具都只支援3dmax內建的skin骨架動畫,還好可以找到轉檔的工具幫我們把physique轉成skin。 沒想到官網上還可以找到for 3dmax7的版本,分享連結在此:   3ds Max SDK Samples/Utilities Physique to Skin Utility – Recompiled for 3ds Max 6 and 3ds Max 7 An update to the physique to skin converter for 3ds Max 6 and 3ds Max 7. No new functionality has been added. phy2skin.zip (zip - 11Kb) 使用方法很簡單,基本上就是選了mesh以後,再按下Tool裡面的"Convert to Max Skin"按紐,再按下確認以後就成功了。 一張圖說明一切: 這邊也有視訊教學可看: [max] physique蒙皮转skin蒙皮的plugins 使用教学

Visual C++ 2008 快速鍵

關於快速鍵,官方有提供一份快速鍵的海報pdf: 由此下載 。列出來的東西好像很多,但真的要找的時候又覺得每個細項的資料都不多,其實還是不好用。(跟Adobe的海報比起來差好多 T_T) 在這邊把覺得比較好用的紀錄一下好了(陸續補充,但也可能永遠只有這幾條 -_-"): 格式化選取的code [ Ctrl+K, Ctrl+F ] View.Navigate-Backward [CTRL+-] View.NavigateForward [CTRL+SHIFT+-] Edit.CompleteWord [CTRL+SPACE or ALT+RIGHT ARROW] Auto-(Re)Format [Ctrl+K, Ctrl+D] find references [Shift+F12] duplicate the current line [Ctrl+C, Ctrl+V] delete the current line [Ctrl+L] search for the current selection [Ctrl+F3] create a bookmark [Ctrl+K, Ctrl+K] go to the next bookmark [Ctrl+K, Ctrl+N ]

認識一下 Inline function

圖片
忘記 inline function為什麼比較快,手上的入門書也沒說明,就google一下找到這篇說明 Inline Function 的文章,說得很清楚詳細。 筆記 To eliminate the cost of calls to small functions, C++ proposes a new feature called inline function. An inline function is a function that is expanded in line when it is invoked. That is, the compiler replaces the function call with the corresponding function codes . We should take utmost care while making a function inline. The speed benefit of an inline function diminishes as it grows in size . At some point the overheads of the function call becomes small as compared to the execution of the function, and the benefits of inline function may be lost. There are few situations where an inline function may not work...

ARToolkit官方文件閱讀筆記[3]: 開發第一個應用

圖片
原文 Developing your First Application, Part 1 筆記 這篇文件主要的重點是在說明所謂的"ARToolKit Step Functions" ,也就是運行ARToolkit的過程中會經歷的6大步驟,這些步驟在原文件中已經被整理成一個清楚的表格。 ARToolKit Step Functions 1. Initialize the application init 2. Grab a video input frame arVideoGetImage  (called in  mainLoop ) 3. Detect the markers arDetectMarker  (called in  mainLoop ) 4. Calculate camera transformation arGetTransMat  (called in  mainLoop ) 5. Draw the virtual objects draw  (called in  mainLoop ) 6. Close the video capture down cleanup 不過這六大步驟中沒有包含全部被實際使用到的ARToolkit函式,所以為了更進一步地了解建構一個AR應用究竟需要用到哪些ARToolkit函式,所以我再把每個步驟內所使用到的function抓出來加到表格中。 ARToolKit Step Functions 1. Initialize the application 由init() 作初使化工作,init內包括的function : arVideoOpen(vconf)[說明: 開啟video設置檔] vconfarVideoInqSize(&amp;xsize, &amp;ysize)[說明: 不懂用途] arParamLoad(cparaname, 1, &amp;wparam)[說明: dat檔和ARParam] arParamChangeSize( &amp;wparam, xsize, ysize, &amp;cparam )[說明: 需要因應攝影機,計算一下參數的變化] arInitCparam( &amp;cparam ) [說明: 設定為讀進來的參

ARToolkit官方文件閱讀筆記[2]: How does ARToolKit work?

原文 How does ARToolKit work? 筆記 Table 1 shows some typical maximum ranges for square markers of different sizes. These results were gathered by making maker patterns of a range of different sizes (length on a side), placing them perpendicular to the camera and moving the camera back until the virtual objects on the squares disappeared. Pattern Size (inches) Usable Range (inches) 2.75 16 3.50 25 4.25 34 7.37 50 Table 1: Tracking range for different sized patterns. The simpler the pattern the better. Patterns with large black and white regions (i.e. low frequency patterns) are the most effective. Replacing the 4.25 inch square pattern used above, with a pattern of the same size but much more complexity, reduced the tracking range from 34 to 15 inches.

ARToolkit官方文件閱讀筆記[1]: 第一個範例

原文 Your First ARToolKit Example 筆記  In each platform you have generally two choices: click on the program from your OS explorer or starting from the command line: the last choice is better since it give you the error and standard output stream (and ARToolKit used it a lot). In this video dialog you can change the output size of the video or the video format acquired from the camera. You need to notice that better the format is similar to ARToolKit tracking format, faster is the acquisition (RGB more efficient). In some camera driver you can also change the frame rate. By default this dialog is associate to your first video input so you can have some problems (see the FAQ ). If you hit the "t" key on the keyboard you will be prompted to enter a new threshold value. This should be a value between 0 and 255; the default is 100. Hitting the "d" key will show the thresholded video image below the main video window . Possible tracking patterns found in the input

Open Scene Graph 的動畫功能?

第二篇Open Scene Graph 的文章就要來宣告暫時停止投入osg的研究了。停止是因為我想做的東西必須要能夠運行骨骼(骨架)動畫,尤其是要能夠運行從3ds max bipe輸出的動畫,但我後來發現幾個事實讓我覺得osg的骨架動畫開發之路可能會非常顛仆,(1)骨架動畫的功能是最近這一版(7.28)才剛加上 OpenSceneGraph 2.8.2 release - bug/build fix release ,可能還需要許多修改;內建的骨架動畫範例用viewer跑不出效果,看來不是預設就能夠運行 (2) 目前似乎不支援從3ds max輸出的骨架動畫,對岸有高手說他正在寫相關的外掛 (3) 對於新骨架動畫功能的討論非常很少,一支手指可以數得出來 基於這些考量,我還是先停下深入研究osg的腳步,再找找看有沒其他更適合的engine

安裝Open Scene Graph

圖片
在網路上找到這篇寫得很仔細的安裝步驟說明文章 Installing OpenSceneGraph 2.8.0 ,我照著步驟做,結果"大致上是成功的",step狀況紀錄如下: (2). 官方的檔案有點難下載,有時下載一半就會斷掉 (6). 解開release版本以後,複製底下的資料夾,蓋到debug資料夾上面。事實上不會有檔案會被蓋到,因為debug版的檔名和release版的都不一樣 (9). 這個指令呼叫的是release版的程式 (10). 最後開始測試,順利開啟"T1000牛"! 以下開始設定Visual Studio (2).  照著各步驟做完以後,找到code來測試,編譯時發現要貼上的osgGA a .lib、osgGA a d.lib怎麼都會多了一個「a」,把a移除之後,release可以正常編譯和執行出結果 所謂的"大致上是成功的"的意思是發現編譯和執行debug版時,編譯可以成功,但執行的時候會發生錯誤,程式說有記憶體問題,接著自動關閉,編譯時錯誤訊息如下: 「LDR: LdrpWalkImportDescriptor() failed to probe C:\Program Files\OpenSceneGraph-2.8.0\bin\osg55-osgd.dll for its manifest, ntstatus 0xc0150002...」 新手我當作沒看到這個訊息。

手動關閉Alert組件的方法

正常關閉Alert組件的方法是在介面上按下是、否、取消的按鈕後即自動關閉,並且可以指定觸發的處理事件。 但實際使用時發現,Alert本身並沒有提供關閉視窗的方法,如果要經由程式來關閉Alert的話,可以使用PopupManager提供的方法。 import mx.managers.PopUpManager; var alert : Alert = Alert.show( message ); PopUpManager.removePopUp( alert );

在AIR中偵測使用者是否閒置的方法

AIR API預設上就支援這個功能了。NativeApplication.nativeApplication.timeSinceLastUserInput值可以取得目前閒置的時間。 private function init():void{ NativeApplication.nativeApplication.idleThreshold = 10; // 設定閒置通知的秒數 NativeApplication.nativeApplication.addEventListener(Event.USER_IDLE , onUserIdle ) ; NativeApplication.nativeApplication.addEventListener(Event.USER_PRESENT , onUserIdle ) ; } private function onUserIdle( event:Event ):void{ if(event.type == Event.USER_IDLE){ // 閒置 }else if(event.type == Event.USER_IDLE){ // 回復使用 } } 可是似乎沒有提供方法可以立刻中斷或reset閒置時間,不管是重設idleThreshold或者removeListener都不行。 idleThreshold 是用來設定「閒置通知事件」的發出時間點,但不管有沒有註冊監聽的事件,timeSinceLastUserInput的值是永遠都啟動、並且持續計算的。

Flex最底層的Application是一個Singleton Class

因此在app的任一個子物件中,用Application.application就可以access到最底層的屬性和物件了。換句話說,最底層的(public的)屬性和物件都是全域的,用一個最簡單的範例做demo。 主程式裡面有一個數字,可以按主程式的按鈕去累加。 main.mxml <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:comp="comp.*"> <mx:Script> <![CDATA[ [Bindable] public var counter:int = 0; ]]> </mx:Script> <mx:Label text="'counter' property in flex app root:" /> <mx:Label text="{counter}" /> <mx:HBox> <mx:Label text="access 'counter' from root:" /> <mx:Button mouseDown="counter++;" label="plus"/> </mx:HBox> <comp:TestApplicationSingleton/> </mx:Application> 另外做一個組件,在組件內部可以直接access到主程式裡面那個累加的數字 comp/TestApplicationSingleton.mxml <?xml version="1.0" encoding="utf-8"?> <mx:Panel x

在AIR裡放一個最精簡的Web Browser

如題。

Flex Log的使用方法

Flex有內建了一套將trace包裝得更高階的 Log Framework可以用。trace()是開發ActionScript的好伴侶,不過當有更高階的需要時又顯得太陽春。 Flex Log的兩大元件為Log和TraceTarget,TraceTarget相關類別是用來指定輸出的目的地,比如TraceTarget本身就是包裝了trace()命令。所以說也可以繼承target的相關類別,將輸出改為輸出到其他地方,如socket。Log則是用來輸出你的log紀錄。 <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onComplete()"> <mx:Script> <![CDATA[ import mx.logging.LogEventLevel; import mx.logging.Log; import mx.logging.targets.TraceTarget; private var _target : TraceTarget; private function onComplete():void{ _target = new TraceTarget(); // _target.includeCategory = true; // 包含的輸出種類 // _target.includeDate = true; _target.includeTime = true; _target.includeLevel = true; _target.filters = ["com.*"]; // * 可用於過濾 // _target.level = LogEventLevel.ALL;  // 以下為各顯示層級,層級高低按照排列列出 // _target.level = LogEventLevel.DEBUG; _target.level

編譯Flex Module的方法

1. 在一般project中新增mxml module。不需特別去編譯,在編譯主application的時候就會被自動編譯 2. 新增一般的mxml檔,以module為最外層包裝,直接編譯該mxml就可以得到swf 3. 使用 mxmlc xxxModule.mxml 工具編譯。建立繼承自module的as class似乎只能用這方法 (編譯的參數可以參考 Compiling modules 這篇)

設定Flex Application FrameRate的方法

方法參考自  Flex tip: a higher frame rate even makes text entry look better   mxml 應用設定的方法 :application frameRate="60"> ActionScript 應用設定的方法 [SWF(frameRate="60")] public class MyApp extends Sprite { ... } 這篇文章也分享了一個重點,就是frame rate的高低其實對Flex內建組件的表現也有影響,更新變高其實也讓組件的回饋(ex:在TextInput打字後文字的顯示)變得更為靈敏。

用Flash開發Flex組件的方法

一搜尋就找到一篇Flash Evanglist寫的不錯的教學 Tutorial: The Flash and Flex marriage ,對我很有幫助。 個人筆記(ps:只記不知道的): When you’ve done that, go ahead and double click on the MyVideoPlayer movieclip. Create a new layer and draw a rectangle with the same size as your FLVPlayback component. Convert this in to a movieclip and specify it’s instance name to “boundingBox”. Once we use our component in Flex, it will not be visible. Flex will use this “boundingBox” movieclip to determine how big your component actually is .  If you’ve done that, we also need to add the player skin we’re using. This goes in to the src folder. So go ahead and drag “SkinOverAllNoFullNoCaption.swf” to the src folder   (play的skin的access路徑是跟著主swf的)  of your Flex project. 文章最後可以找到幾則相關的教學,也不錯 Video tutorial: Create Flex container components with Flash CS4