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

<channel>
	<title>Agit8</title>
	<atom:link href="http://agit8.turbulent.ca/bwp/feed/" rel="self" type="application/rss+xml" />
	<link>http://agit8.turbulent.ca/bwp</link>
	<description>Adventures in web development at Turbulent in Montreal</description>
	<pubDate>Fri, 07 Jan 2011 19:15:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting up a VPN server with Ubuntu 10.04 and strongswan</title>
		<link>http://agit8.turbulent.ca/bwp/2011/01/setting-up-a-vpn-server-with-ubuntu-1004-and-strongswan/</link>
		<comments>http://agit8.turbulent.ca/bwp/2011/01/setting-up-a-vpn-server-with-ubuntu-1004-and-strongswan/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 23:47:33 +0000</pubDate>
		<dc:creator>Benoit Beausejour</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Turbulent]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[ipad]]></category>

		<category><![CDATA[iphone]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[OSX]]></category>

		<category><![CDATA[strongswan]]></category>

		<category><![CDATA[vpn]]></category>

		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://agit8.turbulent.ca/bwp/?p=308</guid>
		<description><![CDATA[This is an unformatted brain dump of my experiences getting a VPN server set up using Ubuntu 10.04 LTS. My target was to get this solution working with native Mac OS X clients as well as Microsoft Windows XP, Vista and 7 clients. I wanted to simply have to give my clients a username, password [...]]]></description>
			<content:encoded><![CDATA[<p>This is an <strong>unformatted brain dump</strong> of my experiences getting a VPN server set up using Ubuntu 10.04 LTS. My target was to get this solution working with native Mac OS X clients as well as Microsoft Windows XP, Vista and 7 clients. I wanted to simply have to give my clients a username, password and preshare key and they would have everything they needed to connect to the VPN. I was able to get this working with strongswan (and not openswan) as well as using xl2tpd.</p>
<p><strong>- Clear any install of strongswan or openswan:</strong></p>
<p><code>apt-get remove strongswan strongswan-dbg strongswan-ikev1 strongswan-ikev2 strongswan-nm strongswan-starter libstrongswan openswan</code></p>
<p><strong>- Install xl2tpd (l2tp server), libfcgi0ldbl, ipsec-tools and libcurl3 (strongswan dependencies)</strong></p>
<p><code>apt-get install xl2tpd libfcgi0ldbl ipsec-tools libcurl3</code></p>
<p><strong>- Install the 4.5.0 back ported packages files (<a href="http://agit8.turbulent.ca/source/packages/strongswan-4.5.0-ubuntu10.04.tar.gz">downloadable here</a>). </strong></p>
<p><em>This is required since I was having troubles with Ubuntu 10.04 default packages of strongswan (4.3.1) when authenticating windows native clients with a PSK, so I simply took the *unstable* version of strongswan 4.5.0 and built them under a fresh 10.04 install. I also activated nat transport mode at compile time since the 4.3.1 packages that ship with 10.04 don&#8217;t have this option activated.</p>
<p>If these packages don&#8217;t work for you, simply build your own.<br />
</em></p>
<p><code><br />
dpkg -i \<br />
 strongswan_4.5.0-1ubuntu2_all.deb \<br />
 strongswan-dbg_4.5.0-1ubuntu2_i386.deb \<br />
 strongswan-ikev1_4.5.0-1ubuntu2_i386.deb \<br />
 strongswan-ikev2_4.5.0-1ubuntu2_i386.deb \<br />
 strongswan-nm_4.5.0-1ubuntu2_i386.deb \<br />
 strongswan-starter_4.5.0-1ubuntu2_i386.deb<br />
</code></p>
<p><strong>/etc/ipsec.conf:</strong></p>
<p><code><br />
config setup<br />
        nat_traversal=yes<br />
        plutostart=yes<br />
        charonstart=yes</p>
<p>conn L2TP-VPN<br />
        type=transport<br />
        keyexchange=ikev1<br />
        keyingtries=3<br />
        authby=psk<br />
        pfs=no<br />
        rekey=no<br />
        left=%defaultroute<br />
        leftnexthop=%defaultroute<br />
        leftprotoport=17/1701<br />
        right=%any<br />
        rightprotoport=17/%any<br />
        rightsubnetwithin=0.0.0.0/0<br />
        auto=add<br />
</code></p>
<p>Here we define the IPsec part of our L2TP over IPsec VPN connection. </p>
<p>We specify a transport type and force the use of IKE v1 (<code>keyexchange=ikev1</code>). This is important because since 4.5.0 strongswan defaults to IKE V2 and at this time fewer client use this (native Windows XP and native Mac OS X still use IKE V1). We will authenticate the IPsec layer with a pre shared key that we give to your clients. (authby=psk) The left part of our link is the server itself (defaultroute being the current main IP, left=%defaultroute), and the right part of our link can be anything (right=%any). We specify rightprotoport=17/%any because OSX clients do not use source port 1701 when connecting. pfs=no makes sure perfect forward is not enabled since our mainstream clients do not support it. rekey=no will make sure the VPN server will not initiate a rekey by itself. auto=add will make the connection start automatically when it matches an incoming client.</p>
<p><strong>/etc/ipsec.secrets:</strong></p>
<p><code><br />
< SERVER PUBLIC IP > %any: PSK &#8220;< YOUR_PRESHARE_KEY_STRING >&#8220;</code></p>
<p>Here you put your preshare key for your VPN server. This information needs to be given to clients to allow them to connect.<br />
(username, password and PSK).</p>
<p><strong>/etc/xl2tpd/xl2tpd.conf:</strong></p>
<p><code><br />
[global]<br />
  port = 1701<br />
  listen-addr = < SERVER_PUBLIC_IP ><br />
  ipsec saref = no</p>
<p>[lns default]<br />
  ip range = 172.16.45.2-255<br />
  local ip = 172.16.45.1<br />
  require authentication = yes<br />
  refuse pap = yes<br />
  require chap = yes<br />
  pppoptfile = /etc/ppp/options.xl2tpd<br />
  ppp debug = yes<br />
  name = < SERVER_NAME ><br />
  length bit = yes<br />
</code></p>
<p>The listen-addr here is important to prevent the daemon from not listening correctly once the ipsec link is done. The Ubuntu default kernel for 10.04 does not come with SAref support, so we explicitely disable it. We require authentication on this link and refuse clear text passwords (pap). We require authentication with chap (the accounts should be defined in the /etc/ppp/chap-secrets file).</p>
<p><strong>/etc/ppp/options.xl2tpd:</strong></p>
<p><code><br />
require-mschap-v2<br />
ms-dns < YOUR_DNS_SERVER ><br />
asyncmap 0<br />
auth<br />
crtscts<br />
idle 1800<br />
lock<br />
hide-password<br />
modem<br />
debug<br />
name < SERVER_NAME ><br />
proxyarp<br />
lcp-echo-interval 30<br />
lcp-echo-failure 4<br />
mtu 1410<br />
mru 1410<br />
connect-delay 500<br />
</code></p>
<p><strong>- /etc/ppp/chap-secrets:</strong></p>
<p><code><br />
myusername * mypassword *<br />
myotherusername * myotherpassword *<br />
</code></p>
<p><strong>- Start xl2tpd and ipsec:</strong></p>
<p><code><br />
service xl2tpd start<br />
service ipsec start<br />
</code></p>
<p><strong>- Firewall rules to put in to allow incoming connections over protocol ESP, ISAKMP(500) , L2TP (1701), PPTP (1723) and Nat traversal (4500).</strong></p>
<p><code><br />
-A INPUT -i eth0 -p esp -j ACCEPT<br />
-A INPUT -i eth0 -p udp --dport 500  -j ACCEPT<br />
-A INPUT -i eth0 -p tcp --dport 500  -j ACCEPT<br />
-A INPUT -i eth0 -p udp --dport 4500 -j ACCEPT<br />
-A INPUT -i eth0 -p udp --dport 1701  -j ACCEPT<br />
-A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT<br />
</code></p>
<p>Lastly for your firewall you will have to decide what you allow your VPN users to see and reach. You can firewall them specifically using the ppp+ interfaces in your iptables.</p>
<p>(ie:  <code>-A FORWARD -i ppp+ -d < SERVER HOST > -p tcp -m tcp &#8211;dport 22 -j ACCEPT</code> )</p>
<p><em><br />
* Note: It seems there&#8217;s is an issue with the 4.5.0 packages in which describing networks in ipsec.conf with full netmask representation (ie: 255.255.255.248) would cause the charon daemon to die. Using the network address mask instead (/29) proved to work correctly&#8230;probably a bug in that version&#8230;</em></p>
<p>Connections should now work from iphones, ipads, windows native clients as well as OSX, provided you use the right creds! I tested on Android 2.2+ and was able to connect correctly.  I would&#8217;nt use these specific versions in production but the process of setting it up and understanding the issues has been somewhat&#8230;entertaining.</p>
<p>I hope this helped someone.</p>
<p>-b</p>
<div class="social_bookmark">
<a><strong><em><br></em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://agit8.turbulent.ca/bwp/2011/01/setting-up-a-vpn-server-with-ubuntu-1004-and-strongswan/&amp;title=Setting+up+a+VPN+server+with+Ubuntu+10.04+and+strongswan" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://agit8.turbulent.ca/bwp/2011/01/setting-up-a-vpn-server-with-ubuntu-1004-and-strongswan/&amp;title=Setting+up+a+VPN+server+with+Ubuntu+10.04+and+strongswan" title="Add to&nbsp;digg"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://agit8.turbulent.ca/bwp/2011/01/setting-up-a-vpn-server-with-ubuntu-1004-and-strongswan/" title="Add to&nbsp;Facebook"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://agit8.turbulent.ca/bwp/2011/01/setting-up-a-vpn-server-with-ubuntu-1004-and-strongswan/&amp;title=Setting+up+a+VPN+server+with+Ubuntu+10.04+and+strongswan" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://agit8.turbulent.ca/bwp/2011/01/setting-up-a-vpn-server-with-ubuntu-1004-and-strongswan/&amp;title=Setting+up+a+VPN+server+with+Ubuntu+10.04+and+strongswan" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://agit8.turbulent.ca/bwp/2011/01/setting-up-a-vpn-server-with-ubuntu-1004-and-strongswan/" title="Add to&nbsp;Technorati"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://agit8.turbulent.ca/bwp/2011/01/setting-up-a-vpn-server-with-ubuntu-1004-and-strongswan/feed/</wfw:commentRss>
		</item>
		<item>
		<title>NFB video player released</title>
		<link>http://agit8.turbulent.ca/bwp/2009/04/nfb-video-player-now-released/</link>
		<comments>http://agit8.turbulent.ca/bwp/2009/04/nfb-video-player-now-released/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 14:09:01 +0000</pubDate>
		<dc:creator>Eric Poirier</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Turbulent]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[pyro]]></category>

		<guid isPermaLink="false">http://agit8.turbulent.ca/bwp/?p=272</guid>
		<description><![CDATA[ In a joint effort, and as previously stated on this very blog, our friends at the NFB and the folks here at Turbulent Media are now making the popular NFB player available for free for anyone seeking to display videos with flash.
The player is available as a compiled swf and is meant for basic [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/nfb-video-player/" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');"><img src="http://agit8.turbulent.ca/bwp/wp-content/2009/04/logonfbonf.gif" alt="logonfbonf" title="logonfbonf" width="182" height="106" class="alignleft size-full wp-image-281" /></a> In a joint effort, and as previously stated on this very blog, our friends at the NFB and the folks here at Turbulent Media are now making the popular NFB player available for free for anyone seeking to display videos with flash.</p>
<p>The player is available as a compiled swf and is meant for basic video showcasing. You are free to use it on your blogs, twits and any other online video needs.</p>
<p>Source code and examples are available for download directly from the google code repository page <a href="http://code.google.com/p/nfb-video-player/" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">nfb-video-player</a>. </p>
<p>This first downloadable BETA package contains complete source code, all the graphical assets and a complete working example of the video player.</p>
<p>This beautiful player holds the Pyro API at its core, and is quite configurable through a series of flashVar parameters. You can easily integrate the player into your blog or website and use the available parameters to your own needs.</p>
<p>It is also the first exemple of a full Pyro integration being officially released, and will, without a doubt, make quite a few people happy, since we’ve been asked  for real life working PYRO exemples.</p>
<p>We will be giving some basic support for questions and bug report related to this player through the <a href="http://code.google.com/p/nfb-video-player/" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">nfb-video-player</a> google code project.</p>
<div class="social_bookmark">
<a><strong><em><br></em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://agit8.turbulent.ca/bwp/2009/04/nfb-video-player-now-released/&amp;title=NFB+video+player+released" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://agit8.turbulent.ca/bwp/2009/04/nfb-video-player-now-released/&amp;title=NFB+video+player+released" title="Add to&nbsp;digg"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://agit8.turbulent.ca/bwp/2009/04/nfb-video-player-now-released/" title="Add to&nbsp;Facebook"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://agit8.turbulent.ca/bwp/2009/04/nfb-video-player-now-released/&amp;title=NFB+video+player+released" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://agit8.turbulent.ca/bwp/2009/04/nfb-video-player-now-released/&amp;title=NFB+video+player+released" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://agit8.turbulent.ca/bwp/2009/04/nfb-video-player-now-released/" title="Add to&nbsp;Technorati"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://agit8.turbulent.ca/bwp/2009/04/nfb-video-player-now-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Pyro now available on google code.</title>
		<link>http://agit8.turbulent.ca/bwp/2009/03/pyro-now-available-on-google-code/</link>
		<comments>http://agit8.turbulent.ca/bwp/2009/03/pyro-now-available-on-google-code/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 18:47:10 +0000</pubDate>
		<dc:creator>Eric Poirier</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Papervision 3D]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://agit8.turbulent.ca/bwp/?p=236</guid>
		<description><![CDATA[LO and behold, Its official, pyro is now on google code. 
You will find it all here: PYRO on google
Thats great news, what will I find there ?
Our google code nest contains the following:
  Version controlled latest pyro updates and documentations (Be in synch with us here, get the latest latest working build).
  [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_242" class="wp-caption alignleft" style="width: 154px"><img src="http://agit8.turbulent.ca/bwp/wp-content/2009/03/pyrosmalllogo11.png" alt="Pyro" width="144" height="144" class="size-full wp-image-242" /><p class="wp-caption-text"> </p></div><br />
<strong>LO and behold, Its official, pyro is now on google code. </strong><br />
You will find it all here: <a href="http://code.google.com/p/pyro-player/" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">PYRO on google</a></p>
<p><strong>Thats great news, what will I find there ?</strong><br />
Our google code nest contains the following:</p>
<li>  Version controlled latest pyro updates and documentations <em>(Be in synch with us here, get the latest latest working build).</em></li>
<li>  Latest stable releases and docs packaged in zip files. </li>
<li>  Upcomming wiki with advices and how-to&#8217;s</li>
<p><strong>Wait a minute, I knew that !</strong><br />
Yeah yeah we know its not really new is it ? Already a seasoned pyro user aren&#8217;t ya, well we just needed to make it official, dont worry, it&#8217;s the exact same repository you&#8217;ve been retrieving pyro from. No need for you to change nor update your pyro svn location.</p>
<p><strong>What the heck are you talking about ? What is this Pyro thing ?</strong><br />
Pyro is a small flash video API we have build. Nothing to brag too much about, but its worth checking out if you deal with video in flash in your line of work.   </p>
<p>Here is a &#8216;résumé&#8217; of what it does: </p>
<li>   Progressive, RTMP (and the likes) and middleware induced streaming all united in one API.</li>
<li>   Loading and progress ratios.</li>
<li>   Client side bandwidth detection.</li>
<li>   Resizing and proportion calculations.</li>
<li>   Auto adjusts buffertime or lets you handle it as you see fit.</li>
<li>   Manages dual treshold bufferTime strategies and single treshold bufferTime.</li>
<li>   Dispatches a flock of Pyro events.</li>
<li>   Regular play, pause, toggle pause , mute, volue, toggle mute, stop, close, width, height methods&#8230;. and so on.</li>
<li>   and more.</li>
<div class="social_bookmark">
<a><strong><em><br></em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://agit8.turbulent.ca/bwp/2009/03/pyro-now-available-on-google-code/&amp;title=Pyro+now+available+on+google+code." title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://agit8.turbulent.ca/bwp/2009/03/pyro-now-available-on-google-code/&amp;title=Pyro+now+available+on+google+code." title="Add to&nbsp;digg"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://agit8.turbulent.ca/bwp/2009/03/pyro-now-available-on-google-code/" title="Add to&nbsp;Facebook"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://agit8.turbulent.ca/bwp/2009/03/pyro-now-available-on-google-code/&amp;title=Pyro+now+available+on+google+code." title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://agit8.turbulent.ca/bwp/2009/03/pyro-now-available-on-google-code/&amp;title=Pyro+now+available+on+google+code." title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://agit8.turbulent.ca/bwp/2009/03/pyro-now-available-on-google-code/" title="Add to&nbsp;Technorati"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://agit8.turbulent.ca/bwp/2009/03/pyro-now-available-on-google-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Spring physics powered 3D camera for Away3D and Papervision</title>
		<link>http://agit8.turbulent.ca/bwp/2009/01/spring-physics-powered-3d-camera-for-away3d-and-papervision/</link>
		<comments>http://agit8.turbulent.ca/bwp/2009/01/spring-physics-powered-3d-camera-for-away3d-and-papervision/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 22:04:48 +0000</pubDate>
		<dc:creator>Benoit Beausejour</dc:creator>
		
		<category><![CDATA[Away3D]]></category>

		<category><![CDATA[Dev]]></category>

		<category><![CDATA[Papervision 3D]]></category>

		<category><![CDATA[3D]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[camera]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[papervision]]></category>

		<category><![CDATA[physics]]></category>

		<category><![CDATA[pv3d]]></category>

		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://agit8.turbulent.ca/bwp/?p=154</guid>
		<description><![CDATA[When building flash 3D application it is often necessary to implement complex routines to manage camera movements. Wether it's a 3rd person follow cam, a first person FPS camera or a more customized movements most of the time it would be desirable for developers to have access to a simple camera that implements a "natural" movement. This is where this Spring physics powered camera comes in.]]></description>
			<content:encoded><![CDATA[<p><a href="http://agit8.turbulent.ca/experiments/springcam/"><img src="http://agit8.turbulent.ca/bwp/wp-content/2009/01/springcam.jpg" alt="Spring powered 3D camera demo" title="Spring powered 3D camera demo" class="alignnone size-full wp-image-156" /></a></p>
<p>When building flash 3D application it is often necessary to implement complex routines to manage camera movements. Wether it&#8217;s a 3rd person follow cam, a first person FPS camera or a more customized movements most of the time it would be desirable for developers to have access to a simple camera that implements a &#8220;natural&#8221; movement. </p>
<p>While developing a small racing game internally as a pet project, I came across the need to develop such a camera, one that would allow us to easily tail a moving object in the scene while keeping the right orientation in relation to the subject. Though, that is simple to do by itself, what really makes this camera interesting is that it&#8217;s not a &#8220;perfect&#8221; follow. In order to give a good acceleration effect on turns and in &#8220;turbo boost&#8221; moments, I wanted a camera that would be a bit late in it&#8217;s follow and allow for smooth and more natural feel, something that you see in classic 3D racing games. </p>
<p>Hence the Spring Camera was born, a camera that works very simply by implementing spring physics between the camera and it&#8217;s target. Imagine the camera is linked by a spring to a target, when the target moves in 3D space the spring extends and then &#8220;pulls&#8221; the camera thus giving a nice natural feel to the movement. </p>
<p><em><strong>&#8220;One camera to rule them all&#8221;<br />
</strong></em><br />
Here is a sample Away3D code to initialize a spring cam in the View. By default, the spring motion is activated once the target property of the camera is set:</p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">
var springcam:SpringCam = new SpringCam();
view.camera = springcam;
springcam.target = myTarget;
</textarea>
<p>Ovbiously, there are more options. 3 main parameters are used to control the behavior of the camera:</p>
<p><strong>Mass</strong> - The &#8220;weight&#8221; of the camera, how difficult it is to pull it.<br />
<strong>Stiffness</strong> - How hard the spring is to extend. A high value here is as if the spring was a stick (or fixed lenght)<br />
<strong>Damping</strong> - Controls how the spring resists the spring &#8220;boingggg&#8221; effect. A higher value makes for a smoother ride, lower values and the more boing you&#8217;ll get.</p>
<p>The camera also implements 2 important offset:</p>
<p><strong>Position offset</strong> - Where the camera should be ideally in relation to the target (in model space). For example, if we want the camera to try to be 100 units behind the target, we&#8217;ll use a value of Number3D(0,0,-100); Obviously if the target moves fast we won&#8217;t stay 100 units behind exactly which is how the effect is created.</p>
<p><strong>Look offset</strong> - Where the camera should look at in relation to the target. By default, the camera look AT the target but you might want to have the camera attempt to look at a different spot. For example, Number3D(-100,0,0) would look 100 units to the left of the target. (all this in target model space).</p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">
springcam.mass = 10;
springcam.damping = 4;
springcam.stiffness = 1;

//Try to look 100 units in front of target
springcam.lookOffset = new Number3D(0,0,100); 

//Try to stay 100 units behind target.
springcam.positionOffset = new Number3D(0,0,-100); 
</textarea>
<p>And that&#8217;s pretty much all there is to it in terms of usage! The camera will automatically set it&#8217;s position in relation to the target based on the physics of the spring every frame without any additional code. Now all you need to do is move the target in 3d space and change it&#8217;s orientation&#8230;the camera will automatically follow.</p>
<p>All of these parameters, including target can be modified at runtime and will be updated real-time so you can do some pretty funky adjustments in your application code to create specific effect when needed.</p>
<p>This camera can be used to build a wide variety of cool cameras movements including but not limited to 3rd person camera, 1st person camera, chase cam, as well as all the standard camera parameters. You can even use it for cool transition effects!</p>
<p>Take a look at the <a href="http://agit8.turbulent.ca/experiments/springcam/">Spring physics powered 3D camera demonstration</a>.</p>
<p><a href="http://agit8.turbulent.ca/source/away3d/SpringCam.as">Download the SpringCam class for Away3D.</a><br />
<em>Simply add the class in your Away3D source in the src/away3d/cameras folder.</em></p>
<p><a href="http://agit8.turbulent.ca/source/papervision/SpringCamera3D.as">Download the SpringCamera3D class for Papervision3D.</a><br />
<em>Simply add the class in your PV3D source in the src/org/papervision3d/cameras folder.<br />
</em></p>
<p>You can also grab the source code to the<a href="http://agit8.turbulent.ca/source/away3d/springcamdemo.zip"> demonstration (away3d 2.2.1+ required)</a></p>
<p><ins datetime="2009-01-22T04:44:16+00:00"><em>Special thanks go to Kim Reeves for giving me a needed hand in whipping up the demo. Kudos!</em></ins></p>
<p><b>UPDATE</b>: <a href="http://pv3d.org/2009/01/23/springcamera3d-and-driving-a-car/" onclick="javascript:pageTracker._trackPageview ('/outbound/pv3d.org');">John Lindquist</a> created a short example using the original Focus example for pv3d with source available.</p>
<p>Hey if you like it or use it in a project, <strong><em>let us know with a comment</em> </strong> and subscribe to our <a href="feed://agit8.turbulent.ca/bwp/feed/atom/">RSS feed</a>!</p>
<div class="social_bookmark">
<a><strong><em><br></em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://agit8.turbulent.ca/bwp/2009/01/spring-physics-powered-3d-camera-for-away3d-and-papervision/&amp;title=Spring+physics+powered+3D+camera+for+Away3D+and+Papervision" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://agit8.turbulent.ca/bwp/2009/01/spring-physics-powered-3d-camera-for-away3d-and-papervision/&amp;title=Spring+physics+powered+3D+camera+for+Away3D+and+Papervision" title="Add to&nbsp;digg"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://agit8.turbulent.ca/bwp/2009/01/spring-physics-powered-3d-camera-for-away3d-and-papervision/" title="Add to&nbsp;Facebook"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://agit8.turbulent.ca/bwp/2009/01/spring-physics-powered-3d-camera-for-away3d-and-papervision/&amp;title=Spring+physics+powered+3D+camera+for+Away3D+and+Papervision" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://agit8.turbulent.ca/bwp/2009/01/spring-physics-powered-3d-camera-for-away3d-and-papervision/&amp;title=Spring+physics+powered+3D+camera+for+Away3D+and+Papervision" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://agit8.turbulent.ca/bwp/2009/01/spring-physics-powered-3d-camera-for-away3d-and-papervision/" title="Add to&nbsp;Technorati"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://agit8.turbulent.ca/bwp/2009/01/spring-physics-powered-3d-camera-for-away3d-and-papervision/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Pyro : a video player API for Flash</title>
		<link>http://agit8.turbulent.ca/bwp/2009/01/pyro-a-video-player-api-for-flash/</link>
		<comments>http://agit8.turbulent.ca/bwp/2009/01/pyro-a-video-player-api-for-flash/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 05:06:21 +0000</pubDate>
		<dc:creator>Eric Poirier</dc:creator>
		
		<category><![CDATA[ActionScript]]></category>

		<category><![CDATA[Dev]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[as3]]></category>

		<category><![CDATA[flv mp4 streaming]]></category>

		<category><![CDATA[open source]]></category>

		<category><![CDATA[pyro]]></category>

		<category><![CDATA[video]]></category>

		<category><![CDATA[video player]]></category>

		<guid isPermaLink="false">http://agit8.turbulent.ca/bwp/?p=115</guid>
		<description><![CDATA[<em>"Why build yet another video player?"</em> you ask. Pyro only integrates the core logic of playing video using flash. Yea, sure, you can build your own thing using NetStream/NetConnection, hey , that's basically what Pyro does and that's what professionnals do. They do it over and over again. So why waste time with all the same problems like size handling, duration, bandwidth detection, etc? It's from this question that Pyro was born.

]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_235" class="wp-caption alignleft" style="width: 257px"><img src="http://agit8.turbulent.ca/bwp/wp-content/2009/03/pyrologo12.png" alt="video player API for flash" width="247" height="247" class="size-full wp-image-235" /><p class="wp-caption-text"> </p></div><br />
Pyro is the name of the class set we have been using internally at Turbulent to build all the media players for our many corporate web clients. It&#8217;s the results of over 10 rewrites and many many revisions. </p>
<p><em>&#8220;Why build yet another video player?&#8221;</em> you ask. Pyro only integrates the core logic of playing video using flash. Yea, sure, you can build your own thing using NetStream/NetConnection, hey , that&#8217;s basically what Pyro does and that&#8217;s what professionnals do. They do it over and over again. So why waste time with all the same problems like size handling, duration, bandwidth detection, etc? It&#8217;s from this question that Pyro was born.</p>
<p>It bundles all core functionalities of standard flash video players but <em>leaves out defined design aspects</em> to the developers while leveraging a common, simple and direct AS3 API for handling progressive http, proxied http and rtmp (rtmps, etc..) streams.</p>
<p>So we wrote some code and documented it.<br />
You can find all the latest versions at our google code repo, <a href="http://code.google.com/p/pyro-player/" onclick="javascript:pageTracker._trackPageview ('/outbound/code.google.com');">right HERE</a>.</p>
<p>For now this is a first release to see if there is interest in the community of using and contributing to Pyro. We use Pyro in a number of commercial applications and we keep adding and supporting the small but very functionnal codebase.</p>
<p>Here&#8217;s a basic usage example:</p>
<p>1.  Create a Pyro instance, insert width then height as arguments and add your pyro instance to the child list. If you don&#8217;t pass it width / height, Pyro will adjust it&#8217;s size to the stream you want to play.</p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">
var pyroInstance:Pyro = new Pyro(320, 240);
addChild(pyroInstance);</code>

pyroInstance.autoAdjustBufferTime = true;
pyroInstance.checkBandwidth = true;


//regular progressive download playback.
pyroInstance.play("http://myvideosite.com/videos/gratton.flv"); 

/* or use a middleware script to start streaming at a defined offset, in which case
    Pyro will take care of feeding your front-end the right data for progress bars etc.
*/
pyroInstance.play("http://myvideosite.com/videos/gratton.flv?start=34.454"); 

/* Don't have any fancy script, hell rtmp support is transparent.
pyroInstance.play("rtmp://mymediaserver.com/streams/gratton.mp4"); 

pyroInstance.pause();

pyroInstance.resize( pyroInstance.width*2, pyroInstance.height*2);

pyroInstance.mute();
pyroInstance.unmute();
pyroInstance.volume(0.5);

</textarea>
<p><em><strong>&#8220;Do one thing but do it well&#8221; </strong></em></p>
<p>Pyro is already at the heart of many of web projects that we have produced in the past few years and such is the case of the National Film Board of canada (NFB). The video player we built for the NFB uses Pyro to implement features like closed-captioning and voice over tracks as well as support 3 modes of streaming. You can see it in action on the <a href="http://www.nfb.ca" onclick="javascript:pageTracker._trackPageview ('/outbound/www.nfb.ca');">www.NFB.ca</a> website.</p>
<p><a href="http://www.nfb.ca" onclick="javascript:pageTracker._trackPageview ('/outbound/www.nfb.ca');"><img src="http://agit8.turbulent.ca/bwp/wp-content/2009/01/nfb-a1.jpg" alt="NFB / ONF player -  built on Pyro" width="300" height="196" class="alignncenter size-full wp-image-146" /></a></p>
<p>Here is a dumb list of what the API provides:</p>
<p>- Support for progressive download (duh)<br />
- Support for progressive download with time offsets ( for streaming from a specific time offset in a file)<br />
- Support for RTMP streaming<br />
- Bandwidth detection<br />
- Automatic bufferTime adjustment based on client bandwidth<br />
- Play / Pause / Buffer state management<br />
- Volume control and mute state<br />
- Many resizing options including ratio, fixed or auto-detect.<br />
- Simple queue point integration and support.<br />
- Duration handling as well as progress ratio<br />
- Load ratio</p>
<p>Hey we&#8217;re not reinventing the wheel here. Just making a small solid video player API that implements what we keep repeating all the time. We&#8217;ve been pretty careful with memory leaks as well, so hopefully the API is not leaking <img src='http://agit8.turbulent.ca/bwp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>PATIENCE PLEASE</strong><br />
Please be indulgent, Pyro is always evolving and is far from beeing perfect. It might be missing features you were desperately hoping for , if that&#8217;s the case, we&#8217;re DEFINITLY opened to developing them. Drop us a comment!</p>
<p>Give it a shot , see if it&#8217;s useful, and if it is, please let us know!</p>
<p><a href="http://code.google.com/p/pyro-player/">Here&#8217;s the docs, and source&#8230;again.<br />
</a></p>
<p>Stay tuned for more examples !</p>
<p>Eric<br />
<img src="http://agit8.turbulent.ca/bwp/wp-content/2009/03/pyrosmalllogo11.png" alt="pyrosmalllogo1" width="144" height="144" class="alignleft size-full wp-image-252" /></p>
<div class="social_bookmark">
<a><strong><em><br></em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://agit8.turbulent.ca/bwp/2009/01/pyro-a-video-player-api-for-flash/&amp;title=Pyro+%3A+a+video+player+API+for+Flash" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://agit8.turbulent.ca/bwp/2009/01/pyro-a-video-player-api-for-flash/&amp;title=Pyro+%3A+a+video+player+API+for+Flash" title="Add to&nbsp;digg"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://agit8.turbulent.ca/bwp/2009/01/pyro-a-video-player-api-for-flash/" title="Add to&nbsp;Facebook"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://agit8.turbulent.ca/bwp/2009/01/pyro-a-video-player-api-for-flash/&amp;title=Pyro+%3A+a+video+player+API+for+Flash" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://agit8.turbulent.ca/bwp/2009/01/pyro-a-video-player-api-for-flash/&amp;title=Pyro+%3A+a+video+player+API+for+Flash" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://agit8.turbulent.ca/bwp/2009/01/pyro-a-video-player-api-for-flash/" title="Add to&nbsp;Technorati"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://agit8.turbulent.ca/bwp/2009/01/pyro-a-video-player-api-for-flash/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MeshMorph Shapes updated: Fix to Cassini</title>
		<link>http://agit8.turbulent.ca/bwp/2008/10/meshmorph-shapes-updated-fix-to-cassini/</link>
		<comments>http://agit8.turbulent.ca/bwp/2008/10/meshmorph-shapes-updated-fix-to-cassini/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 20:42:06 +0000</pubDate>
		<dc:creator>Benoit Beausejour</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[cassini]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[morphing]]></category>

		<category><![CDATA[papervision]]></category>

		<category><![CDATA[shapes]]></category>

		<guid isPermaLink="false">http://agit8.turbulent.ca/bwp/?p=68</guid>
		<description><![CDATA[


Marpi from the Papervision channel contacted me regarding a problem with the Cassini shape in our previous post Papervision3D: Quad layer - Shape morphing source . Seems the that vertices and UV coordinates for the shape were not computed correctly. Well I took some time to correct the problem and realign the UV and vertices [...]]]></description>
			<content:encoded><![CDATA[<p><center></p>
<p><a href="/experiments/meshMorph/"><img src="http://agit8.turbulent.ca/bwp/wp-content/2008/10/picture-8-300x189.png" alt="" title="picture-8" width="300" height="189" class="aligncenter size-medium wp-image-72" /></a><br />
</center></p>
<p>Marpi from the Papervision channel contacted me regarding a problem with the Cassini shape in our previous post<a href="http://agit8.turbulent.ca/bwp/2008/05/20/papervision3d-quad-layer-shape-morphing-source/"> Papervision3D: Quad layer - Shape morphing source </a>. Seems the that vertices and UV coordinates for the shape were not computed correctly. Well I took some time to correct the problem and realign the UV and vertices of the shape so all should be in order now!</p>
<p>Unfortunately, even the updated code is made using PV3D-Effects branch, which is outdated now! I do believe the code will function correctly using the latest pv3d trunk, though if anyone encounters some problems and that there is some demand I&#8217;ll make an official port.</p>
<p>Download the updated source shapes <a href="http://agit8.turbulent.ca/experiments/meshMorph/turbulent_shapes1.zip">here</a>.</p>
<p>The <a href="http://agit8.turbulent.ca/experiments/meshMorph/">original experiment</a> was also updated.</p>
<p>Happy peanuts! (cassini)</p>
<p>-b</p>
<div class="social_bookmark">
<a><strong><em><br></em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://agit8.turbulent.ca/bwp/2008/10/meshmorph-shapes-updated-fix-to-cassini/&amp;title=MeshMorph+Shapes+updated%3A+Fix+to+Cassini" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://agit8.turbulent.ca/bwp/2008/10/meshmorph-shapes-updated-fix-to-cassini/&amp;title=MeshMorph+Shapes+updated%3A+Fix+to+Cassini" title="Add to&nbsp;digg"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://agit8.turbulent.ca/bwp/2008/10/meshmorph-shapes-updated-fix-to-cassini/" title="Add to&nbsp;Facebook"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://agit8.turbulent.ca/bwp/2008/10/meshmorph-shapes-updated-fix-to-cassini/&amp;title=MeshMorph+Shapes+updated%3A+Fix+to+Cassini" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://agit8.turbulent.ca/bwp/2008/10/meshmorph-shapes-updated-fix-to-cassini/&amp;title=MeshMorph+Shapes+updated%3A+Fix+to+Cassini" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://agit8.turbulent.ca/bwp/2008/10/meshmorph-shapes-updated-fix-to-cassini/" title="Add to&nbsp;Technorati"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://agit8.turbulent.ca/bwp/2008/10/meshmorph-shapes-updated-fix-to-cassini/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash AS3 optimization - Fastest way to copy an array</title>
		<link>http://agit8.turbulent.ca/bwp/2008/08/flash-as3-optimization-fastest-way-to-copy-an-array/</link>
		<comments>http://agit8.turbulent.ca/bwp/2008/08/flash-as3-optimization-fastest-way-to-copy-an-array/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 22:13:19 +0000</pubDate>
		<dc:creator>Benoit Beausejour</dc:creator>
		
		<category><![CDATA[Dev]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[bytearray]]></category>

		<category><![CDATA[concat]]></category>

		<category><![CDATA[copy]]></category>

		<category><![CDATA[for]]></category>

		<category><![CDATA[loop]]></category>

		<category><![CDATA[slice]]></category>

		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://agit8.turbulent.ca/bwp/?p=52</guid>
		<description><![CDATA[Been having an interesting discussion on the papervision3d channel on freenode. (irc.freenode.net #papervision3d) The question asked by a member was: &#8220;What&#8217;s the fastest way to copy an array in flash as3?&#8221; So Tom Richardson and I made some tests for fun and profit (some guys bet a beer and pizza to Tom that a simple [...]]]></description>
			<content:encoded><![CDATA[<p>Been having an interesting discussion on the papervision3d channel on freenode.<em> (irc.freenode.net #papervision3d)</em> The question asked by a member was: &#8220;<strong>What&#8217;s the fastest way to copy an array in flash as3?</strong>&#8221; So <a href="http://www.willeatforfood.com/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.willeatforfood.com');">Tom Richardson</a> and I made some tests for fun and profit (some guys bet a beer and pizza to Tom that a simple for() loop would win the race) so I started to make a small and barebones test. Obviously knowing we were getting the goods ; we set out to prove them wrong!</p>
<p>We were evaluating some small snippets of code:<br />
- The basic for loop with push calls<br />
- The basic while loop<br />
- ByteArray copying/cloning<br />
- Optimized for loop<br />
- slice()<br />
- concat()</p>
<p>We took an array of 500000 elements (all random floats) as source and went for a copy, and here are the results!</p>
<p>List of 500000 elements.<br />
for() unoptimized: <strong>118ms</strong><br />
for() key-key optimized: <strong>30ms</strong><br />
while() key-key optimized: <strong>30ms</strong><br />
Bytearray copy: <strong>176ms</strong><br />
Array slice(): <strong>19ms</strong><br />
Array concat(): <strong>8ms</strong></p>
<p>The obvious big time winner seems to be using concat()! Less function calls, less evaluations (and hey less code!) Extremely elegant as well <img src='http://agit8.turbulent.ca/bwp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Billy owes us pizza and beer.</p>
<p>Interestingly though, I was most surprised by the slowness of the unoptimized for() loop, scoring just over 100ms, compared to 180ms to perform a complete deep copy (bytearray)&#8230;that&#8217;s pretty poor. I guess developers would really gain some outstanding performance simply by optimizing their for() loops. </p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">
var copy:Array = sourceArray.concat();
</textarea>
<p>Using concat() also wins over slice() by about 10ms, which I&#8217;m not entirely sure why. I guess there might be addition function calls inside the language. Anybody got some insights on this?</p>
<p>Here is a small snippet demonstrating it and especially proving the copy array isn&#8217;t a reference:</p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">
import flash.utils.getTimer;
import flash.utils.*;

var list:Array = new Array();
for(var i:int = 0; i < 500000; i++)
{
	list.push(Math.random()*500000);
}
trace("List of "+list.length);

/***********/
var t6s:Number = getTimer();
var copy6:Array = list.concat();
var t6e:Number = getTimer();
trace("concat() copy: "+(t6e-t6s)+"ms");
trace("Copy6 has: "+copy6.length);
copy6.pop();
copy6.shift();
trace("Copy6 now has: "+copy6.length);
trace("List has: "+list.length);
</textarea>
<p>Here is the source of the tests! Please don&#8217;t be afraid to kick and whine if something is not right. I&#8217;m also very interested in seeing if there would be an even FASTER way!</p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">
import flash.utils.getTimer;

import flash.utils.*;


//Create the source array
var list:Array = new Array();
for(var i:int = 0; i < 500000; i++)
{
	list.push(Math.random()*500000);
}
trace("List of "+list.length+" elements.");

/***********/

//TEST-1 Barebones for loop, unoptimized.

var t1s:Number = getTimer();
var copy:Array = new Array();
for(var j:int = 0; j < list.length; j++)
{
	copy.push( list[i] );
}
var t1e:Number = getTimer();
trace("for() unoptimized: "+(t1e-t1s)+"ms");


/***********/


//TEST-2 Barebones for loop, optimized.

var t2s:Number = getTimer();
var copy2:Array = new Array();
var l2:int = list.length;
for(var m:int = 0; m < l2; ++m)
{
	copy2[m] = list[m];
}
var t2e:Number = getTimer();
trace("for() key-key optimized: "+(t2e-t2s)+"ms");



//TEST-3 Barebones while loop, optimized.

var t3s:Number = getTimer();
var k:int = 0;
var l:int = list.length;
var copy3:Array = new Array(list.length);
while(k < l)
{
	copy3[k] = list[++k];
}
var t3e:Number = getTimer();
trace("while() key-key optimized: "+(t3e-t3s)+"ms");


//TEST-4 Bytearray copy
var t4s:Number = getTimer();
var copier:ByteArray = new ByteArray();
copier.writeObject(list);
copier.position = 0;
var copy4:Array = copier.readObject();
var t4e:Number = getTimer();
trace("Bytearray copy: "+(t4e-t4s)+"ms");

//TEST-5 slice() copy
var t5s:Number = getTimer();
var copy5:Array = list.slice(0, list.length);
var t5e:Number = getTimer();
trace("Array slice(): "+(t5e-t5s)+"ms");
//TEST-6 concat() copy
var t6s:Number = getTimer();
var copy6:Array = list.concat();
var t6e:Number = getTimer();
trace("Array concat(): "+(t6e-t6s)+"ms");
</textarea>
<div class="social_bookmark">
<a><strong><em><br></em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://agit8.turbulent.ca/bwp/2008/08/flash-as3-optimization-fastest-way-to-copy-an-array/&amp;title=Flash+AS3+optimization+-+Fastest+way+to+copy+an+array" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://agit8.turbulent.ca/bwp/2008/08/flash-as3-optimization-fastest-way-to-copy-an-array/&amp;title=Flash+AS3+optimization+-+Fastest+way+to+copy+an+array" title="Add to&nbsp;digg"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://agit8.turbulent.ca/bwp/2008/08/flash-as3-optimization-fastest-way-to-copy-an-array/" title="Add to&nbsp;Facebook"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://agit8.turbulent.ca/bwp/2008/08/flash-as3-optimization-fastest-way-to-copy-an-array/&amp;title=Flash+AS3+optimization+-+Fastest+way+to+copy+an+array" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://agit8.turbulent.ca/bwp/2008/08/flash-as3-optimization-fastest-way-to-copy-an-array/&amp;title=Flash+AS3+optimization+-+Fastest+way+to+copy+an+array" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://agit8.turbulent.ca/bwp/2008/08/flash-as3-optimization-fastest-way-to-copy-an-array/" title="Add to&nbsp;Technorati"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://agit8.turbulent.ca/bwp/2008/08/flash-as3-optimization-fastest-way-to-copy-an-array/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash Player 10 - 3D rendering in a simple loop (source)</title>
		<link>http://agit8.turbulent.ca/bwp/2008/06/flash-player-10-3d-rendering-in-a-simple-loop-source/</link>
		<comments>http://agit8.turbulent.ca/bwp/2008/06/flash-player-10-3d-rendering-in-a-simple-loop-source/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 21:09:24 +0000</pubDate>
		<dc:creator>Sylvain Nolot</dc:creator>
		
		<category><![CDATA[Dev]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[3D]]></category>

		<category><![CDATA[astro]]></category>

		<category><![CDATA[drawtriangles]]></category>

		<category><![CDATA[fp10]]></category>

		<category><![CDATA[matrix3d]]></category>

		<category><![CDATA[perspectiveprojection]]></category>

		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://agit8.turbulent.ca/bwp/?p=50</guid>
		<description><![CDATA[

I have been very busy playing with the latest features presented in the beta codenamed &#8220;Astro&#8221; of the next version of the Flash Player. Benoit and I were curious to know what it would look like to render some 3D objects without using a full library like Papervision and using only the new core classes [...]]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://agit8.turbulent.ca/experiments/astro/kidney/SimpleModelRender.swf" onclick="javascript:pageTracker._trackPageview ('/downloads/swf/simplemodelrender.swf');"><img src="http://agit8.turbulent.ca/bwp/wp-content/2008/06/screenshot.jpg" alt="3D rendering in native fp10" title="screenshot" width="500" height="269" class="aligncenter size-full wp-image-51" /></a><br />
</center></p>
<p>I have been very busy playing with the latest features presented in the beta codenamed &#8220;Astro&#8221; of the next version of the Flash Player. <a href="http://agit8.turbulent.ca/bwp/author/ben/">Benoit</a> and I were curious to know what it would look like to render some 3D objects without using a full library like Papervision and using only the new core classes included in the player, namely : <a href="http://injun.ru/flash10api/flash/geom/PerspectiveProjection.html" onclick="javascript:pageTracker._trackPageview ('/outbound/injun.ru');">PerspectiveProjection</a>, <a href="http://injun.ru/flash10api/flash/geom/Vector3D.html" onclick="javascript:pageTracker._trackPageview ('/outbound/injun.ru');">Vector3D</a> and <a href="http://injun.ru/flash10api/flash/geom/Matrix3D.html" onclick="javascript:pageTracker._trackPageview ('/outbound/injun.ru');">Matrix3D</a>.</p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">
import flash.geom.PerspectiveProjection;
import flash.geom.Vector3D;
import flash.display.TriangleCulling;
import flash.geom.Matrix3D;
</textarea>
<p>Using only these and obviously the new additions to the <a href="http://injun.ru/flash10api/flash/display/Graphics.html" onclick="javascript:pageTracker._trackPageview ('/outbound/injun.ru');">Graphics API</a>, especially the  <a href="http://injun.ru/flash10api/flash/display/Graphics.html#drawTriangles()" onclick="javascript:pageTracker._trackPageview ('/outbound/injun.ru');">drawTriangles</a>() set of methods, we were able to create a small example of one of our dynamic parametric shapes (the Kidney) and render it in 3D with rotations. All this without a full 3D library! Pretty nice to see alot of stuff has been pushed in the core of the player! </p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">
output.graphics.clear();
output.graphics.beginBitmapFill(texture);
output.graphics.drawTriangles(vertices, indices, primitive.uvs, TriangleCulling.NEGATIVE);
</textarea>
<p>The new Vector array seems really nice, though there&#8217;s been some people discussing that there wasn&#8217;t a significant performance boost from using them since the generics used with them (the <>) would be applied at runtime. Haven&#8217;t had the time to verify that&#8230; I&#8217;ll just go ahead, close my eyes and believe <img src='http://agit8.turbulent.ca/bwp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>We&#8217;re working at pushing this demo in <a href="http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit" onclick="javascript:pageTracker._trackPageview ('/outbound/labs.adobe.com');">PixelBender</a> space to see how it performs with some basic shading operations, but up to now it looks very promising!  <a href="http://agit8.turbulent.ca/bwp/author/ben/">Benoit</a> and I often meet next to the coffee machine dreaming of writing our own baby 3D engine written with astro&#8217;s new functionnality&#8230;why not I say!  Kudos to Adobe!</p>
<p>Launch the <a href="http://agit8.turbulent.ca/experiments/astro/kidney/SimpleModelRender.swf" onclick="javascript:pageTracker._trackPageview ('/downloads/swf/simplemodelrender.swf');">Kidney Astro SWF</a></p>
<p>Peek at the <a href="http://agit8.turbulent.ca/experiments/astro/kidney/SimpleModelRender.as">full file right here and now</a> for a wider view or grab the <a href="http://agit8.turbulent.ca/experiments/astro/kidney/SimpleModelRender.zip">full source</a> while it&#8217;s hot!</p>
<p>* Obviously, you need the<a href="http://labs.adobe.com/technologies/flashplayer10/" onclick="javascript:pageTracker._trackPageview ('/outbound/labs.adobe.com');"> fp10 beta</a> to view the SWF =)</p>
<div class="social_bookmark">
<a><strong><em><br></em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://agit8.turbulent.ca/bwp/2008/06/flash-player-10-3d-rendering-in-a-simple-loop-source/&amp;title=Flash+Player+10+-+3D+rendering+in+a+simple+loop+%28source%29" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://agit8.turbulent.ca/bwp/2008/06/flash-player-10-3d-rendering-in-a-simple-loop-source/&amp;title=Flash+Player+10+-+3D+rendering+in+a+simple+loop+%28source%29" title="Add to&nbsp;digg"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://agit8.turbulent.ca/bwp/2008/06/flash-player-10-3d-rendering-in-a-simple-loop-source/" title="Add to&nbsp;Facebook"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://agit8.turbulent.ca/bwp/2008/06/flash-player-10-3d-rendering-in-a-simple-loop-source/&amp;title=Flash+Player+10+-+3D+rendering+in+a+simple+loop+%28source%29" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://agit8.turbulent.ca/bwp/2008/06/flash-player-10-3d-rendering-in-a-simple-loop-source/&amp;title=Flash+Player+10+-+3D+rendering+in+a+simple+loop+%28source%29" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://agit8.turbulent.ca/bwp/2008/06/flash-player-10-3d-rendering-in-a-simple-loop-source/" title="Add to&nbsp;Technorati"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://agit8.turbulent.ca/bwp/2008/06/flash-player-10-3d-rendering-in-a-simple-loop-source/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Papervision3D: Quad layer - Shape morphing source</title>
		<link>http://agit8.turbulent.ca/bwp/2008/05/papervision3d-quad-layer-shape-morphing-source/</link>
		<comments>http://agit8.turbulent.ca/bwp/2008/05/papervision3d-quad-layer-shape-morphing-source/#comments</comments>
		<pubDate>Tue, 20 May 2008 15:00:11 +0000</pubDate>
		<dc:creator>Benoit Beausejour</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Papervision 3D]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[effects]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[geometry]]></category>

		<category><![CDATA[greatwhite]]></category>

		<category><![CDATA[papervision]]></category>

		<category><![CDATA[papervision3d]]></category>

		<category><![CDATA[paulebourke]]></category>

		<category><![CDATA[quad]]></category>

		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://agit8.turbulent.ca/bwp/?p=47</guid>
		<description><![CDATA[

Revisiting our Dynamic shape morphing  work, I finally got time to clean up the source and have it ready for release. Sorry it took so long! I also parametrized the shape morph, allowing you to choose a more &#8220;bouncy&#8221; or &#8220;elastic&#8221; look   (*cough*feature creep*cough*)
The first element in the source package contains the [...]]]></description>
			<content:encoded><![CDATA[<p><center><a href="http://agit8.turbulent.ca/experiments/meshMorph"><img src="http://agit8.turbulent.ca/bwp/wp-content/2008/05/shapemorph2.png" alt="" title="Shape morphing update" width="540" class="aligncenter size-full wp-image-49" /></a><br />
</center></p>
<p>Revisiting our <a href="http://agit8.turbulent.ca/bwp/2008/02/25/dynamic-shape-morphing-with-papervision-3d/">Dynamic shape morphing </a> work, I finally got time to clean up the source and have it ready for release. Sorry it took so long! I also parametrized the shape morph, allowing you to choose a more &#8220;bouncy&#8221; or &#8220;elastic&#8221; look <img src='http://agit8.turbulent.ca/bwp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  (*cough*feature creep*cough*)</p>
<p>The first element in the source package contains the  Quad geometry layer, allowing you to create geometry as Quads instead of triangles. (It actually still is 2 triangles!) The quad geometry class already has methods to add/remove quads to the geometry as well as fun &#8220;draw&#8221; and &#8220;morph&#8221; methods to go from one geometry to another. </p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">

public function clearGeometry():void
public function addQuad(q:Quad):void
public function removeQuad(q:Quad):void

public function updateNormals():void
public function draw( targetGeom:QuadGeometry, t:Number):Boolean
public function morph( initialGeom:QuadGeometry, targetGeom:QuadGeometry, split:Number, easing:String='easeOutQuint' ):Boolean

</textarea>
<p>Also available is our first shape pack. All the 3D shapes we ported from Paul Bourke&#8217;s list are available in this pack and can be used as you please in your own projects. Obviously, these 3D objects are using quad geometry. We&#8217;ve ported many more shapes for fun; we&#8217;ll most likely release another shape pack in the coming weeks. </p>
<p>Here&#8217;s the current list of shapes in the pack:<br />
- Apple<br />
- Astroidale<br />
- Cassini<br />
- Corne<br />
- EllipticTorus<br />
- HandkerchiefSurface<br />
- Heart<br />
- JetSurface<br />
- KidneySurface<br />
- KleinBottle<br />
- KleinBottle2<br />
- LimpetThorus<br />
- ScherckSurface<br />
- Pillow<br />
- ShellNut<br />
- SpringShape<br />
- TriaxialHexatorus<br />
- TearDrop</p>
<p>We did not include static DisplayObject3D shapes to go with all of those shape geometry, so in order to use one of those in your project you will need to do as follows:</p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">

import ca.turbulent.papervision.mesh.*;

var shape3d:DisplayObject3D = new DisplayObject3D("myshape");
var astroidale:Astroidale = new Astroidale(shape3d);
shape3d.geometry = astroidale;

</textarea>
<p>Here&#8217;s a small snippet on how you would go about morphing between 2 objects:</p>
<textarea name="code" class="js:showcolumns:nogutter" cols="60" rows="10">

//at creation
var myShape:DisplayObject3D = new DisplayObject3D("myShape");
var apple:Apple = new Apple();
var jet:JetSurface = new JetSurface();
var myGeom:QuadGeometry = new QuadGeometry(myShape);

myShape.geometry = myGeom;

//... snip

public var t:Number = 0;

// ENTER_FRAME, or Timer call until morph completed (t>=1)
public function morphTick(e:*=null):void
{
	if(t>=1) return;
	
	//morph myShape from apple to jet
	myGeom.morph( apple, jet, t, 'easeOutQuint');
	t+=0.0025;
}

</textarea>
<p>These sources should be compatible with Papervision3D GreatWhite and Effects.</p>
<p>The source to the actually Flex application in the demo is also up for grabs in that package demonstrating many of the features of this small quad kit.</p>
<p>I hope this proves useful to someone, and if so, let me know!</p>
<p><a href="http://agit8.turbulent.ca/experiments/meshMorph/meshMorph-source.zip">Download the full meshMorph source</a> <em>(Flex app, Textures, Quad classes and Shapes)</em><br />
or<br />
<a href="http://agit8.turbulent.ca/experiments/meshMorph/turbulent_shapes1.zip">Download turbulent_shapes1</a> (Quad classes and shapes only)</p>
<p>enjoy!</p>
<div class="social_bookmark">
<a><strong><em><br></em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://agit8.turbulent.ca/bwp/2008/05/papervision3d-quad-layer-shape-morphing-source/&amp;title=Papervision3D%3A+Quad+layer+-+Shape+morphing+source" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://agit8.turbulent.ca/bwp/2008/05/papervision3d-quad-layer-shape-morphing-source/&amp;title=Papervision3D%3A+Quad+layer+-+Shape+morphing+source" title="Add to&nbsp;digg"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://agit8.turbulent.ca/bwp/2008/05/papervision3d-quad-layer-shape-morphing-source/" title="Add to&nbsp;Facebook"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://agit8.turbulent.ca/bwp/2008/05/papervision3d-quad-layer-shape-morphing-source/&amp;title=Papervision3D%3A+Quad+layer+-+Shape+morphing+source" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://agit8.turbulent.ca/bwp/2008/05/papervision3d-quad-layer-shape-morphing-source/&amp;title=Papervision3D%3A+Quad+layer+-+Shape+morphing+source" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://agit8.turbulent.ca/bwp/2008/05/papervision3d-quad-layer-shape-morphing-source/" title="Add to&nbsp;Technorati"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://agit8.turbulent.ca/bwp/2008/05/papervision3d-quad-layer-shape-morphing-source/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash CS3 Bug on Mac OS X and subversion (.svn files)</title>
		<link>http://agit8.turbulent.ca/bwp/2008/05/flash-cs3-bug-on-mac-os-x-and-subversion-svn-files/</link>
		<comments>http://agit8.turbulent.ca/bwp/2008/05/flash-cs3-bug-on-mac-os-x-and-subversion-svn-files/#comments</comments>
		<pubDate>Thu, 01 May 2008 18:05:14 +0000</pubDate>
		<dc:creator>Benoit Beausejour</dc:creator>
		
		<category><![CDATA[Dev]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[.svn]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[cs3]]></category>

		<category><![CDATA[ide]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[OSX]]></category>

		<category><![CDATA[problem]]></category>

		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://agit8.turbulent.ca/bwp/?p=44</guid>
		<description><![CDATA[
While developping our latest project we encountered a bug in the Flash IDE that caused us many headaches and woes. Our project was setup in the Flash IDE with assets and files located in subdirectories, nothing fancy. Right on the last day of production, suddenly after a particular commit , our project would no longer [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://agit8.turbulent.ca/bwp/wp-content/2008/05/macosx_flash_error.png"><img src="http://agit8.turbulent.ca/bwp/wp-content/2008/05/macosx_flash_error.png" alt="Flash IDE bug with .svn files" title="Flash IDE bug with .svn files" width="500" height="192" class="aligncenter size-full wp-image-45" /></a></p>
<p>While developping our latest project we encountered a bug in the Flash IDE that caused us many headaches and woes. Our project was setup in the Flash IDE with assets and files located in subdirectories, nothing fancy. Right on the last day of production, suddenly after a particular commit , our project would no longer compile. Flash would return the standard compiler error: <em>&#8220;A definition for the document class could not be found in the classpath, so one will be automatically generated in the SWF file upon export.&#8221;</em> The document class is in the same directory as the FLA! What in god&#8217;s name is going on! </p>
<p>It turns out Flash is not able find any classes in the project&#8217;s directory. Even when creating a new FLA file with a classpath entry to the project&#8217;s directory ; the compiler would just refuse to find ANY classes in that particular directory. </p>
<p>After about a day of investigation, we isolated the problem to OSX, as PC checked out working copies of the project would function properly. We also found out that by doing a subversion &#8220;EXPORT&#8221; of the project (basically removing the .svn files from the project dir) the project would magically start working again.</p>
<p>After another day of headaches and stress we finally figured it out. It seems that under OSX *ONLY*, if you have a directory in your classpath that is under subversion control (has .svn files) and that any one single directory has over 128 files subversionned, it will make the flash compiler class lookup fail silently and stop. You&#8217;ll get the usual compiler error messages for unfound classes.</p>
<p>The solution?</p>
<p><em><strong>Make sure that no single directory in your project has over 128 files in it under subversion control.</strong></em> If you have one, simply segment it into sub directories and commit.</p>
<p>Simple, tested and true.</p>
<p>I hope this saves some problems to others, I&#8217;m sure releaved I found it.</p>
<p>-b</p>
<div class="social_bookmark">
<a><strong><em><br></em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://agit8.turbulent.ca/bwp/2008/05/flash-cs3-bug-on-mac-os-x-and-subversion-svn-files/&amp;title=Flash+CS3+Bug+on+Mac+OS+X+and+subversion+%28.svn+files%29" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://agit8.turbulent.ca/bwp/2008/05/flash-cs3-bug-on-mac-os-x-and-subversion-svn-files/&amp;title=Flash+CS3+Bug+on+Mac+OS+X+and+subversion+%28.svn+files%29" title="Add to&nbsp;digg"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://agit8.turbulent.ca/bwp/2008/05/flash-cs3-bug-on-mac-os-x-and-subversion-svn-files/" title="Add to&nbsp;Facebook"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://agit8.turbulent.ca/bwp/2008/05/flash-cs3-bug-on-mac-os-x-and-subversion-svn-files/&amp;title=Flash+CS3+Bug+on+Mac+OS+X+and+subversion+%28.svn+files%29" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://agit8.turbulent.ca/bwp/2008/05/flash-cs3-bug-on-mac-os-x-and-subversion-svn-files/&amp;title=Flash+CS3+Bug+on+Mac+OS+X+and+subversion+%28.svn+files%29" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://agit8.turbulent.ca/bwp/2008/05/flash-cs3-bug-on-mac-os-x-and-subversion-svn-files/" title="Add to&nbsp;Technorati"><img class="social_img" src="http://agit8.turbulent.ca/bwp/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://agit8.turbulent.ca/bwp/2008/05/flash-cs3-bug-on-mac-os-x-and-subversion-svn-files/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
