Saqoosha

XML-RPC Server としての AMFPHP

Blog

おひさ。最近は iPhone アプリつくってみたりとかしてます。
いやー、Objective-C は以前ちょっとやってたから抵抗ないんだけど UIKit とかのクセをつかむまでは大変でござるな。SDK の自由度もなかなか低くて。動画キャプチャぐらいさせてくれよっていう。

んでまあ、Objective-C でサーバーサイドとやりとりするんはどーやったらええねん?っといろいろ調べたところ XML-RPC がらくちんぽい。(オープンソースでやっちゃってる WordPress for iPhone も XML-RPC で通信。ってまーブログエディタだからあたりまえだけど。)でー、サーバーサイドを PHP で書こうと思ったんだけど PEAR のんとか書くのすんげえめんどい。。。むにゃむにゃ。ピコーン!てなかんじで AMFPHP が XML-RPC 対応してることを思い出したわけですな。(1.9 beta2 のほうね)

AMFPHP って XML-PRC でのメソッド呼び出しにも対応してるのよ。ひとつサービスつくると AMF と XML-RPC の両方でアクセスできるっていう。しかもサービス書くのは普通に PHP のクラス書くだけでいい。ちょーラクチン。(実は JSON での応答も対応してるんだけどこれはちょっと特殊。JSONP でも JSON-RPC でもないので呼び出し側は自力で実装しなきゃいけない。)

んでこれを書いておこうと思ったのでした。1.9 beta2 のそのままだと日本語が変にエンコードされちゃって使えないのでちょっといじります。amfphp/core/xmlrpc/app/Actions.php の 51 行目ぐらい。エスケープすべき文字種と XML のエンコードを指定。

$output_options = array('escaping' => 'markup', 'encoding' => 'UTF-8');
$args = array($xmlrpc_server, $request_xml, array(&$classConstruct, $methodName), $output_options);

はい。めでたしめでたし。
あー、でも、どうせなら AMF でやりとりするほうが効率いいよなー。だれか Cocoa 用の AMF デコーダーみたいなん書いてー。

手のひら式打ち上げ花火

BlogFLARToolKit

涼しくなってきましたねえ、夏も終わりですよ。つーわけで、ふと思い立ったので作ったのでした。まともに FLARToolKit 使ったのは初めてですね。手のひら式打ち上げ花火。どんなのかは↓デモムービー見ればすぐわかってもらえるかと。(手のひら式とかいいつつムービーでは机の上だったりとか、まあいいや。)


Desktop Fireworks from Saqoosha on Vimeo.

自分でも試したーいって人は、
1. Webcam を用意する。
2. マーカーを用意する。(この PDF を印刷するべし)
3. このページ開く。
4. カメラにマーカーをうつす。
5. 画面が暗くなったらマーカー認識 OK。
6. 画面クリックすると打ち上げられる。(スペースキーでフルスクリーンモード。)
ってな感じ。

なーんかでも花火って立体感ないからあんまし AR 感つーか、そこにある感がないんだなあ。マーカー動かしたりするとわかるんだけど。

ソースコードも置いとくー。Flex Builder project 一式。そうめん使いまくり。

Edit (2008/12/5): FLARToolKit forum is setup. If you have any question about this demo, please use this forum.

Categories: FLARToolKit

Comments (38)

  • みのん
    どもっす。
    花火すてきんぐ!

    なんとなく、花火の光とかがカメラに反映されたら結構そこにある感でるんじゃ無いかなーとふと思ったので、独り言を残しておくテスト。
    (めんどくさそうですけど)
  • Saqoosha
    え、どゆことww
  • みのん
    およ、説明へたくそでスミマセン・・・

    リアルで実際に花火とかが上がったら、花火の光で周囲が明るくなるじゃないっすか。それをカメラのソースに適用してやるって事です。

    赤い花火が上がったらカメラの画像が一瞬赤く光ったり、緑の花火だったら緑っぽくなったりって事なんですけど・・・うーん、口で説明しにくいっす。

    思いつきと想像で言ってるので、実際の効果のほども微妙くさい気もしますしね(ぉぃ
  • Saqoosha
    あー、はいはい。なるほろ。ちょとやってみっか。
  • [...] I’ve seen for a while now. Saqoosha, a Japanese Flash developer, made this little demo: Desktop Fireworks. You will need a the Flash Player 9, a webcam and you’ll need to print out this marker. [...]
  • leresteux
    SUPER ! apres le premier test en ligne j ai attendu la suite et vraiment BRAVO... j attends maintenant quelque chose de plus maniable pour un neophite tel que moi.
    merci pour tout ce travail

    SUPER! After the first test in line I waited the continuation and really CHEER… now I wait something of more handy for a neophyte such as me. Thank you for all this work

    ju'
  • [...] things I’ve seen for a while now. Saqoosha, a Japanese Flash developer, made this little demo: Desktop Fireworks. You will need a the Flash Player 9, a webcam and you’ll need to print out this marker. I’ve [...]
  • Rob McCardle
    This is brilliant, thanks for sharing :)
  • bug
    hey, sorry for bothering you, but I don't understand how to use the AS files inside of flash. how do I set up a file to use these? I've downloaded the source, but do not understand how to build the swf using the source files.
    I have the same issue with flartoolkit2. there is no FLA file so I am a little lost.... thank you and sorry to bother, I would just really like to try using this!
  • Saqoosha
    Hi,
    I used Flex Builder to build "Desktop Fireworks". The sample code included in FLARToolKit 2.0 is for Flex Builder too. So no .fla file is included.
    But the sample code can be compile with Flash. Please try instruction below.

    1. Set the dimension at "Document Properties" to 640 x 480 and Frame rate to 30.
    2. Set the document class to "net.saqoosha.flartoolkit.example.SimpleCube".
    3. Add classpath for Papervision3D.
    4. Publish.
  • Fer
    Hello,

    First of all thanks a lot, for deploying all this great stuff!,
    It´s really amazing!

    I've tried to compile but I´m a little bit frustate cause I´m having troubles with:

    1119: org.libspark.flartoolkit.pv3d:FLARCamera3D

    in Console it says me that this class is trying to acces a property in Camera3D class named _projection that it´s not available.

    I´m deploying with Flash Develop and I think all the classpaths FLARTOOLKIT and PAPERVISION (GreatWhite) are correct.

    Thanks in advance.

    FER
  • Fer
    Finally I think I solve the problem !
    Just changing the property to protected,
    It´s really amazing ...

    I´ll keep trying with more ...

    You have a mailing list or something else to discuss this new tec?

    Thanks!
  • Boy Scout
    Hello everyone. Hello Fer. I too would like to know if anyone can help me with the installation of this demo. I downloaded the trunk using the svn client Versions, but don't really know where to go from here.

    I have a demo that I would like to try and integrate into this code and am willing to share!

    Thanks!
  • Jason
    I am using Flex Builder 2 and getting an 1046 error for every Thread reference even though Thread is properly being imported?

    Any suggestions?
  • bobo
    I was fooling around with the demo and the flex project. How do i get the fireworks to start?
  • dj
    Can you post the flash version setup with the .fla? Thanks
  • Craig
    Is it possible to just change it to a basic 3D model to rotate it around without any special effects?
  • [...] 手のひら式打ち上げ花火 [...]
  • [...] Ένα επίσης ενδιαφέρων βίντεο από τον εμπνευστή του FLARtoolkit είναι εδώ (σόρρυ αλλά το site είναι στα Ιαπωνέζικα): [...]
  • [...] Desktop Fireworks [...]
  • George Nimeh
    This is fantastic!

    Do you do freelance work? I'd like to hire you for a project. :-)

    So nice. Thanks for creating this.
  • [...] Saqoosha.net :: ??????????? [...]
  • [...] Molinos de viento: http://ge.ecomagination.com/smartgrid/#/augmented_reality Fuegos artificiales: http://saqoosha.net/2008/08/31/1221/ (Imprimir PDF, lanzar aplicación, poner plantilla a la vista y hacer clic con el ratón para que [...]
  • Archon Dev
    Oh, cant reproduce this effect.... seem to have it done as it should be (i don't know japaneese, but i undestood about marker and swf). It becomes dark and... nothing. =(
  • Archon Dev
    Oh, sorry - didn't figure out i had to click... found that in code...
    btw: is there a way to apply multiple instances for the same marker? for example - adding tree markers one after another (using just 1 marker pattern)?
  • [...] Desktop Fireworks!, we had to use our ninja skills (Google) to translate this one properly, but once you print out the marker visit this site press the space bar for 3d fireworks action. [...]
  • Alberto Lignano Sabbiadoro
    WoooW this is the future!!!!
  • Chikyuu
    ビデオが長KOOLです。が、上に書いたリンクちょっとブローケン可能背ありますか。ダウンできなくて困ります、教えて下さい。doumo。
  • [...] helipad aj s fungujúcim vrtulníkom. Prípadne niečo zaujímavejšie? Čo tak napríklad ohňostroj na [...]
  • [...] Molinos de viento: http://ge.ecomagination.com/smartgrid/#/augmented_reality Fuegos artificiales: http://saqoosha.net/2008/08/31/1221/ (Imprimir PDF, lanzar aplicación, poner plantilla a la vista y hacer clic con el ratón para que [...]
  • MaritH
    Hi!
    Do you know if it is possible to use this on the HTC hero mobile? I tried the NYartoolkit, but the camera on the phone only displays 1fps.. Any ideas? Great project you´ve done, I love it:)!
    -marith
  • asdxp
    нихуя не работает эта поебень
  • Syscl
    woohoo.. augmented reality is very amazing! :D
  • Dan Hanna
    Has the target itself been deleted?
  • daynie
    Hi,
    Is there any sample for combining fireworks with Collada (.dae)?
    Rgds,
  • ガイダンス | yoppa org
    [...] 手のひら打ち上げ花火 http://saqoosha.net/2008/08/31/1221/ [...]
  • yyy
    the screen put black and not work anyting
  • […] You can check out some cool demos of it here: http://saqoo.sh/a/1221 […]

大阪てら子 17 「Flash で時計大会」

Blog

久しぶりの大阪てら子な気がしますねー。久しぶりすぎてなんも企画決まってなかったので、東京てら子のネタをこっちでもやりましょうー。

なんでもいいから時計作ってきてください。時計じゃなくっても時間にからんでるやつなら OK。TeraClock 使ってもいいね! 残念ながらこっちには賞品はないでーすw

開催日時:2008年09月20日(土)(14:00~ [途中参加OK])
開催場所:大阪府 (AID-DCC Inc. Osaka office) ←場所変わりました
いつも通り 18:30 ぐらいから 2 次会もやるよ。2 次会からの参加も OK。

今回は mixi じゃなくって ATND っつー MTL がやってるサービスを使って参加募集することにしてみました。(詳しくはこつら)これだと mixi に入ってなくっても参加できていいですな。OpenID 対応だから mixi アカウントでも入れるし。

つーことで大阪てら子 17 に参加したいひとはこちらで参加表明してくださいな。
追記(9/17 11:00):いっぱいなったので締め切りー。

んじゃっ。

Teraco-Logoてら子とは。 Flash / ActionScript を中心に、情報共有をしたくて、いてもたってもいられない人達による集会ということでよろしくお願いします。