<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.3" -->
<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/"
	>

<channel>
	<title>labs.hellokeita.com</title>
	<link>http://labs.hellokeita.com</link>
	<description>Yet another labs blog</description>
	<pubDate>Thu, 03 Jul 2008 19:54:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>
	<language>en</language>
			<item>
		<title>Adobe Flash Player 10 Beta 2 Released</title>
		<link>http://labs.hellokeita.com/2008/07/04/adobe-flash-player-10-beta-2-released/</link>
		<comments>http://labs.hellokeita.com/2008/07/04/adobe-flash-player-10-beta-2-released/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 19:54:51 +0000</pubDate>
		<dc:creator>keita</dc:creator>
		
		<category><![CDATA[Astro]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/2008/07/04/adobe-flash-player-10-beta-2-released/</guid>
		<description><![CDATA[http://weblogs.macromedia.com/labs/archives/2008/07/flash_player_10.html
http://labs.adobe.com/technologies/flashplayer10/releasenotes.html
]]></description>
			<content:encoded><![CDATA[<p><a href='http://weblogs.macromedia.com/labs/archives/2008/07/flash_player_10.html' target='_blank'>http://weblogs.macromedia.com/labs/archives/2008/07/flash_player_10.html</a></p>
<p><a href='http://labs.adobe.com/technologies/flashplayer10/releasenotes.html' target='_blank'>http://labs.adobe.com/technologies/flashplayer10/releasenotes.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2008/07/04/adobe-flash-player-10-beta-2-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cannes Cyber Lion 2008 Gold</title>
		<link>http://labs.hellokeita.com/2008/06/20/cannes-cyber-lion-2008-gold/</link>
		<comments>http://labs.hellokeita.com/2008/06/20/cannes-cyber-lion-2008-gold/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 16:11:10 +0000</pubDate>
		<dc:creator>keita</dc:creator>
		
		<category><![CDATA[Award]]></category>

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

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

		<guid isPermaLink="false">http://labs.hellokeita.com/2008/06/20/cannes-cyber-lion-2008-gold/</guid>
		<description><![CDATA[My first Cannes, and also gold!
All the following awards are from Rec You.
Cannes
Cyber Gold - Interactive Campaigns
One Show
Silver - Integrated Branding Campaign / Interactive and Non-Interactive (pdf)
Clio Awards
Silver - Interactive / Innovative Use Of Technology
Shortlist – Interactive / Fresh Approach
Shortlist – Content &#038; Contact / Personal Items
D&#038;AD
Nomination - Online Advertising/Digital Advertising Campaign
Asia Pacific Advertising Festival
Best [...]]]></description>
			<content:encoded><![CDATA[<p>My first Cannes, and also gold!</p>
<p>All the following awards are from Rec You.</p>
<p><a href='http://www.canneslions.com/winners/cyber/win_2_1_02379.htm' target='_blank'><b>Cannes</b><br />
Cyber Gold - Interactive Campaigns</a></p>
<p><a href='http://www.oneclub.org/images/pdf/2008OSIPencils.pdf' target='_blank'><b>One Show</b><br />
Silver - Integrated Branding Campaign / Interactive and Non-Interactive (pdf)</a></p>
<p><a href='http://www.clioawards.com/downloads/2008_Clio_Awards_Winners.pdf' target='_blank'><b>Clio Awards</b><br />
Silver - Interactive / Innovative Use Of Technology<br />
Shortlist – Interactive / Fresh Approach<br />
Shortlist – Content &#038; Contact / Personal Items</a></p>
<p><a href='http://www.dandad.org/awards08/entry.asp?entry_id=32136' target='_blank'><b>D&#038;AD</b><br />
Nomination - Online Advertising/Digital Advertising Campaign</a></p>
<p><a href='http://www.asiapacificadfest.com/All_winner_list_2008.pdf' target='_blank'><b>Asia Pacific Advertising Festival</b><br />
Best – Campaign for Integrated Cyber Campaign</a></p>
<p><a href='http://www.adcglobal.org/downloads/ADC87WinnersList.pdf' target='_blank'><b>87th The Art Directors Club</b><br />
Merit – Advertising Interactive/New Media Innovation and Development</a></p>
<p><a href='http://tokyo.interactive.ad.awards.jp/Results08/list.html' target='_blank'><b>Tokyo Interactive Ad Awards</b><br />
Gold – Website / Campaign website<br />
Gold – Integrated campaign<br />
Silver – Advertising / Banner<br />
Nomination – Advertising / Other Interactive Ads</a></p>
<p>Congratulations for all the people involved, and also to Uniqlock for getting almost all the Grand Prix of the world.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2008/06/20/cannes-cyber-lion-2008-gold/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to use custom Shaders in Astro(Flash 10)</title>
		<link>http://labs.hellokeita.com/2008/05/20/how-to-use-custom-shaders-in-astroflash-10/</link>
		<comments>http://labs.hellokeita.com/2008/05/20/how-to-use-custom-shaders-in-astroflash-10/#comments</comments>
		<pubDate>Mon, 19 May 2008 17:04:54 +0000</pubDate>
		<dc:creator>keita</dc:creator>
		
		<category><![CDATA[PixelBender]]></category>

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

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

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

		<guid isPermaLink="false">http://labs.hellokeita.com/2008/05/20/how-to-use-custom-shaders-in-astroflash-10/</guid>
		<description><![CDATA[Here is a simple example using the sample exposure shader that comes with the Adobe&#8217;s PixelBender tutorial.

<object	type="application/x-shockwave-flash"
			data="/files/shader/Shader.swf"
			width="400"
			height="300">
	<param name="movie" value="/files/shader/Shader.swf" />
</object>
(Moving the mouse from horizontally will change the exposure value)
Firstly, you need the PixelBenderToolkit(http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit).
I used the Exposure sample code from Adobe&#8217;s Pixel Bender tutorial (http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit:Tutorial)

&#60;languageversion&#62;
&#160; kernel NewFilter
&#160; &#60;&#160; namespace : &#8220;your namespace&#8221;;
&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple example using the sample exposure shader that comes with the Adobe&#8217;s PixelBender tutorial.</p>

<object	type="application/x-shockwave-flash"
			data="/files/shader/Shader.swf"
			width="400"
			height="300">
	<param name="movie" value="/files/shader/Shader.swf" />
</object><br />
(Moving the mouse from horizontally will change the exposure value)</p>
<p>Firstly, you need the PixelBenderToolkit(<a href="http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit" target="_blank">http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit</a>).</p>
<p>I used the Exposure sample code from Adobe&#8217;s Pixel Bender tutorial (<a href="http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit:Tutorial" target="_blank">http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit:Tutorial</a>)</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;languageversion&gt;<br />
&nbsp; kernel NewFilter<br />
&nbsp; &lt;&nbsp; <span class="kw2">namespace</span> : <span class="st0">&#8220;your namespace&#8221;</span>;<br />
&nbsp; &nbsp; vendor : <span class="st0">&#8220;your vendor&#8221;</span>;<br />
&nbsp; &nbsp; version : <span class="nu0">1</span>;<br />
&nbsp; &nbsp; description : <span class="st0">&#8220;your description&#8221;</span>;<br />
&nbsp; &gt;<br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; input image4 src;<br />
&nbsp; &nbsp; output pixel4 dst;<br />
&nbsp; &nbsp; parameter <span class="kw4">float</span> exposure<br />
&nbsp; &nbsp; &lt;<br />
&nbsp; &nbsp; &nbsp; minValue:<span class="kw4">float</span><span class="br0">&#40;</span>-<span class="nu0">0</span>.<span class="nu0">5</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; maxValue:<span class="kw4">float</span><span class="br0">&#40;</span><span class="nu0">0</span>.<span class="nu0">5</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; defaultValue:<span class="kw4">float</span><span class="br0">&#40;</span><span class="nu0">0</span>.<span class="nu0">0</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &gt;;<br />
&nbsp; &nbsp; <span class="kw4">void</span><br />
&nbsp; &nbsp; evaluatePixel<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; float4 inputColor = sampleNearest<span class="br0">&#40;</span>src, outCoord<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; dst.<span class="me1">rgb</span> = <span class="kw3">pow</span><span class="br0">&#40;</span>inputColor.<span class="me1">rgb</span>, float3<span class="br0">&#40;</span><span class="nu0">1</span>.<span class="nu0">0</span> - exposure<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; dst.<span class="me1">a</span> = inputColor.<span class="me1">a</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span></div>
</div>
<p>On PixelBender Toolkit, you can export it as Byte Code Filter for Flash from the File menu.</p>
<p>Exporting it, you will have a .pbj file to be loaded as ByteArray from Flash just like this.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">var</span> urlLoader:URLLoader = <span class="kw2">new</span> URLLoader<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
urlLoader.<span class="me1">dataFormat</span> = URLLoaderDataFormat.<span class="me1">BINARY</span>;<br />
urlLoader.<span class="me1">addEventListener</span><span class="br0">&#40;</span>Event.<span class="me1">COMPLETE</span>, urlLoaderComplete<span class="br0">&#41;</span>;<br />
urlLoader.<span class="kw3">load</span><span class="br0">&#40;</span><span class="kw2">new</span> URLRequest<span class="br0">&#40;</span><span class="st0">&#8220;exposure.pbj&#8221;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</div>
<p>And after that, creating a Shader instance, and also the ShaderFilter to be applied on a DisplayObject.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw3">private</span> <span class="kw2">function</span> urlLoaderComplete<span class="br0">&#40;</span>ev:Event<span class="br0">&#41;</span>:<span class="kw3">void</span><br />
<span class="br0">&#123;</span><br />
&nbsp; shader = <span class="kw2">new</span> Shader<span class="br0">&#40;</span>ev.<span class="me1">currentTarget</span>.<span class="kw3">data</span> as ByteArray<span class="br0">&#41;</span>;<br />
&nbsp; shaderFilter = <span class="kw2">new</span> ShaderFilter<span class="br0">&#40;</span>shader<span class="br0">&#41;</span>;<br />
&nbsp; filters = <span class="br0">&#91;</span>shaderFilter<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p>Once you have the shader instance, you can change the shader parameters by doing the following.</p>
<div class="codesnip-container" >
<div class="codesnip">shader.<span class="kw3">data</span>.<span class="me1">exposure</span>.<span class="me1">value</span> = <span class="br0">&#91;</span><span class="nu0">0</span>.<span class="nu0">5</span><span class="br0">&#93;</span>;</p>
<p>filters = <span class="br0">&#91;</span>shaderFilter<span class="br0">&#93;</span>; <span class="co1">//re-applying the filter </span><br />
&nbsp;</div>
</div>
<p>Easy huh?</p>
<p><a href="http://labs.hellokeita.com/files/shader/Shader.zip">Here is all the source from this little tutorial.</a></p>
<p>Enjoy.</p>
<p>(update. Just because Zeh said to)<br />

<object	type="application/x-shockwave-flash"
			data="/files/shader/TwirlShader.swf"
			width="400"
			height="300">
	<param name="movie" value="/files/shader/TwirlShader.swf" />
</object><br />
One more example using the <a href="http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&amp;loc=en_us&amp;extid=1536021" target="_blank">TwirlFilter</a> created by Elba Sobrino.<br />
Works the same way, move the mouse along the image.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2008/05/20/how-to-use-custom-shaders-in-astroflash-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flash Player 10 - Aka Astro</title>
		<link>http://labs.hellokeita.com/2008/05/15/flash-player-10-aka-astro/</link>
		<comments>http://labs.hellokeita.com/2008/05/15/flash-player-10-aka-astro/#comments</comments>
		<pubDate>Thu, 15 May 2008 11:45:07 +0000</pubDate>
		<dc:creator>keita</dc:creator>
		
		<category><![CDATA[Flash CS4]]></category>

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

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

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

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

		<guid isPermaLink="false">http://labs.hellokeita.com/2008/05/15/flash-player-10-aka-astro/</guid>
		<description><![CDATA[Adobe launched a Flash Player 10 beta, aka Astro.
I&#8217;m just posting some links about Astro and Flash CS4 that I found. I anybody wants more info about it, just google it.
Astro release notes: http://labs.adobe.com/technologies/flashplayer10/releasenotes.html
Astro demos and videos: http://labs.adobe.com/technologies/flashplayer10/demos/index.html
Native3D sample code: http://download.macromedia.com/pub/labs/flashplayer10/sampleSource/Native3D_Sample.zip
An example using InverseKinematics (Flash CS4 new feature): http://theflashblog.com/?cat=34
Dynamic sound generation in Flash CS4: http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-1.html
http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-2.html
http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-3.html
(update) [...]]]></description>
			<content:encoded><![CDATA[<p>Adobe launched a Flash Player 10 beta, aka Astro.</p>
<p>I&#8217;m just posting some links about Astro and Flash CS4 that I found. I anybody wants more info about it, just google it.</p>
<p>Astro release notes: <a href="http://labs.adobe.com/technologies/flashplayer10/releasenotes.html" target="_blank">http://labs.adobe.com/technologies/flashplayer10/releasenotes.html</a></p>
<p>Astro demos and videos: <a href="http://labs.adobe.com/technologies/flashplayer10/demos/index.html" target="_blank">http://labs.adobe.com/technologies/flashplayer10/demos/index.html</a><br />
Native3D sample code: <a href="http://download.macromedia.com/pub/labs/flashplayer10/sampleSource/Native3D_Sample.zip" target="_blank">http://download.macromedia.com/pub/labs/flashplayer10/sampleSource/Native3D_Sample.zip</a></p>
<p>An example using InverseKinematics (Flash CS4 new feature): <a href="http://theflashblog.com/?cat=34" target="_blank">http://theflashblog.com/?cat=34</a></p>
<p>Dynamic sound generation in Flash CS4: <a href="http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-1.html" target="_blank">http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-1.html</a><br />
<a href="http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-2.html" target="_blank">http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-2.html</a><br />
<a href="http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-3.html" target="_blank">http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-3.html</a></p>
<p>(update) And, if you want to build a Flash 10 content, you need the last nightly build Flex 3:<br />
<a href='http://opensource.adobe.com/wiki/display/flexsdk/Targeting+Flash+Player+10+Beta+with+Flex+SDK+3.0.x' target='_blank'>http://opensource.adobe.com/wiki/display/flexsdk/Targeting+Flash+Player+10+Beta+with+Flex+SDK+3.0.x</a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2008/05/15/flash-player-10-aka-astro/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TextField Selection Color</title>
		<link>http://labs.hellokeita.com/2008/03/13/textfield-selection-color/</link>
		<comments>http://labs.hellokeita.com/2008/03/13/textfield-selection-color/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 12:35:00 +0000</pubDate>
		<dc:creator>keita</dc:creator>
		
		<category><![CDATA[TextField]]></category>

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

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

		<guid isPermaLink="false">http://labs.hellokeita.com/2008/03/13/textfield-selection-color/</guid>
		<description><![CDATA[Well, I just made a class to change the textField selection color.
It manipulates the ColorMatrixFilter to change the colors of the unselected text, selection background and selected text.

<object	type="application/x-shockwave-flash"
			data="/files/textHighlight/textSelectionColor.swf"
			width="468"
			height="170">
	<param name="movie" value="/files/textHighlight/textSelectionColor.swf" />
</object>
The source is in my SVN, http://code.hellokeita.in/public/trunk/as3/br/hellokeita/utils/TextFieldColor.as
And the usage is really simple too.

var textColor:uint = 0xff0000; // unselected text color
var selectionColor:uint [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I just made a class to change the textField selection color.<br />
It manipulates the ColorMatrixFilter to change the colors of the unselected text, selection background and selected text.</p>

<object	type="application/x-shockwave-flash"
			data="/files/textHighlight/textSelectionColor.swf"
			width="468"
			height="170">
	<param name="movie" value="/files/textHighlight/textSelectionColor.swf" />
</object>
<p>The source is in my SVN, <a href="http://code.hellokeita.in/public/trunk/as3/br/hellokeita/utils/TextFieldColor.as" target="_blank">http://code.hellokeita.in/public/trunk/as3/br/hellokeita/utils/TextFieldColor.as</a></p>
<p>And the usage is really simple too.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">var</span> <span class="kw3">textColor</span>:uint = 0xff0000; <span class="co1">// unselected text color</span><br />
<span class="kw2">var</span> selectionColor:uint = 0&#215;00ff00; <span class="co1">// selected background color</span><br />
<span class="kw2">var</span> selectedColor:uint = 0&#215;0000ff; <span class="co1">// selected text color</span></p>
<p><span class="kw2">var</span> tf:<span class="kw3">TextField</span> = <span class="kw2">new</span> <span class="kw3">TextField</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>addChild<span class="br0">&#40;</span>tf<span class="br0">&#41;</span>;</p>
<p><span class="kw2">var</span> tfc:TextFieldColor = <span class="kw2">new</span> TextFieldColor<span class="br0">&#40;</span>tf, <span class="kw3">textColor</span>, selectionColor, selectedColor<span class="br0">&#41;</span>;</p>
<p><span class="co1">//&#8230;</span><br />
<span class="co1">// Or Also</span><br />
<span class="co1">//&#8230;</span></p>
<p>tfc.<span class="kw3">textColor</span> = <span class="kw3">textColor</span>;<br />
tfc.<span class="me1">selectionColor</span> = selectionColor;<br />
tfc.<span class="me1">selectedColor</span> = selectedColor;</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2008/03/13/textfield-selection-color/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My own 3d engine&#8230;</title>
		<link>http://labs.hellokeita.com/2008/02/13/my-own-3d-engine/</link>
		<comments>http://labs.hellokeita.com/2008/02/13/my-own-3d-engine/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 20:13:38 +0000</pubDate>
		<dc:creator>keita</dc:creator>
		
		<category><![CDATA[Sandy3d]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://labs.hellokeita.com/2008/02/13/my-own-3d-engine/</guid>
		<description><![CDATA[Uff&#8230; long time I don&#8217;t write here&#8230;
So&#8230; what I have been doing?
Actually&#8230; nothing interesting&#8230;
Then, couple days ago I started developing my own 3d engine.
I won&#8217;t make it public because it will take all my free time that I actually don&#8217;t have&#8230;
I didn&#8217;t run any benchmarks, I think it&#8217;s more heavy processing than Papervision3d.
anyway&#8230; here is [...]]]></description>
			<content:encoded><![CDATA[<p>Uff&#8230; long time I don&#8217;t write here&#8230;</p>
<p>So&#8230; what I have been doing?<br />
Actually&#8230; nothing interesting&#8230;<br />
Then, couple days ago I started developing my own 3d engine.<br />
I won&#8217;t make it public because it will take all my free time that I actually don&#8217;t have&#8230;</p>
<p>I didn&#8217;t run any benchmarks, I think it&#8217;s more heavy processing than Papervision3d.</p>
<p>anyway&#8230; here is it&#8230;</p>

<object	type="application/x-shockwave-flash"
			data="/files/k3d/20080213.swf"
			width="400"
			height="300">
	<param name="movie" value="/files/k3d/20080213.swf" />
</object>
]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2008/02/13/my-own-3d-engine/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Multi Gradient</title>
		<link>http://labs.hellokeita.com/2008/01/24/multi-gradient/</link>
		<comments>http://labs.hellokeita.com/2008/01/24/multi-gradient/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 17:52:39 +0000</pubDate>
		<dc:creator>keita</dc:creator>
		
		<category><![CDATA[Graphics]]></category>

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

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

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

		<guid isPermaLink="false">http://labs.hellokeita.com/2008/01/24/multi-gradient/</guid>
		<description><![CDATA[
<object	type="application/x-shockwave-flash"
			data="/files/misc/poliGradient.swf"
			width="468"
			height="468">
	<param name="movie" value="/files/misc/poliGradient.swf" />
</object>
It&#8217;s a gradient created from the corners of the square.
I was googling and I found the Diamond-Square on Wikipedia.
The idea is quite simple.
First you get the top left and bottom left corner colors of the square. Than, you get the half height of the edge and also the [...]]]></description>
			<content:encoded><![CDATA[
<object	type="application/x-shockwave-flash"
			data="/files/misc/poliGradient.swf"
			width="468"
			height="468">
	<param name="movie" value="/files/misc/poliGradient.swf" />
</object>
<p>It&#8217;s a gradient created from the corners of the square.<br />
I was googling and I found the <a href="http://en.wikipedia.org/wiki/Diamond-square_algorithm" target="_blank">Diamond-Square</a> on Wikipedia.</p>
<p>The idea is quite simple.<br />
First you get the top left and bottom left corner colors of the square. Than, you get the half height of the edge and also the average color of those colors.<br />
You repeat that until you have all pixels of the edge.</p>
<p><em>Note: The average color is not (color2 - color1) * .5.<br />
It&#8217;s (color2.r - color1.r) * .5 << 16 + (color2.g - color1.g) * .5 << 8 + (color2.b - color1.b) * .5.<br />
</em></p>
<p>After that, you make the same with the right edge.</p>
<p>Than, you do it for each edge from the top to bottom.</p>
<p>If you work around more, you can create gradient spots from any pixel you wish easily.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2008/01/24/multi-gradient/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Grayscale Converter</title>
		<link>http://labs.hellokeita.com/2008/01/19/grayscale-converter/</link>
		<comments>http://labs.hellokeita.com/2008/01/19/grayscale-converter/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 18:00:33 +0000</pubDate>
		<dc:creator>keita</dc:creator>
		
		<category><![CDATA[Graphics]]></category>

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

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

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

		<guid isPermaLink="false">http://labs.hellokeita.com/2008/01/19/grayscale-converter/</guid>
		<description><![CDATA[Answering to CK

   1.
      ck said,
      January 14, 2008 @ 8:07 pm · Edit
      … you mentioned to use BitmapData.paletteMap() to generate a grayscale image. Until now I didn’t get this working. How did you do that?

You can [...]]]></description>
			<content:encoded><![CDATA[<p>Answering to CK</p>
<blockquote><p>
   1.<br />
      ck said,</p>
<p>      January 14, 2008 @ 8:07 pm · Edit</p>
<p>      … you mentioned to use BitmapData.paletteMap() to generate a grayscale image. Until now I didn’t get this working. How did you do that?
</p></blockquote>
<p>You can convert a BitmapData to Grayscale easily without using my ColorUtils class.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw3">import</span> br.<span class="me1">hellokeita</span>.<span class="me1">utils</span>.<span class="me1">ColorUtils</span>;</p>
<p>&#8230;</p>
<p><span class="kw2">var</span> bmpData:BitmapData = <span class="kw2">new</span> BitmapData<span class="br0">&#40;</span>w, h<span class="br0">&#41;</span>;</p>
<p>&#8230;</p>
<p><span class="kw2">var</span> grayscaleArray:<span class="kw3">Array</span> = <span class="kw2">new</span> <span class="kw3">Array</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> c:<span class="kw3">Number</span>;<br />
<span class="kw1">for</span><span class="br0">&#40;</span><span class="kw2">var</span> i = <span class="nu0">0</span>; i &lt; 0xff; i++<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; c = i * .<span class="nu0">3</span> + i * .<span class="nu0">59</span> + i * .<span class="nu0">11</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; grayscaleArray<span class="br0">&#91;</span>i<span class="br0">&#93;</span> = <span class="br0">&#40;</span>c&lt;&lt;<span class="nu0">16</span><span class="br0">&#41;</span> + <span class="br0">&#40;</span>c&lt;&lt;<span class="nu0">8</span><span class="br0">&#41;</span> + c;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="br0">&#125;</span></p>
<p>bmpData.<span class="me1">paletteMap</span><span class="br0">&#40;</span>bmpData, bmpData.<span class="me1">rect</span>, <span class="kw2">new</span> Point<span class="br0">&#40;</span><span class="nu0">0</span>,<span class="nu0">0</span><span class="br0">&#41;</span>, grayscaleArray, grayscaleArray, grayscaleArray<span class="br0">&#41;</span>;</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2008/01/19/grayscale-converter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>BitmapData.lock benchmark</title>
		<link>http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/</link>
		<comments>http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 10:22:34 +0000</pubDate>
		<dc:creator>keita</dc:creator>
		
		<category><![CDATA[Benchmark]]></category>

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

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

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

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

		<guid isPermaLink="false">http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/</guid>
		<description><![CDATA[Well, I don&#8217;t know if anybody read the Thomas Pfeiffer aka Kiroukou (the Sandy3D creator and project leader) commented on my previous post.
Here&#8217;s what he said.
 Indeed Sandy does a clone of the original texture, for few reasons:
- avoid an unfortunate dispose call.
- allowing to have a setTransparency method to dynamically change the transparency without [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I don&#8217;t know if anybody read the Thomas Pfeiffer aka Kiroukou (the <a href="http://www.flashsandy.org/" target="_blank">Sandy3D</a> creator and project leader) commented on my <a href="http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/#comments" target="_blank">previous post</a>.<br />
Here&#8217;s what he said.</p>
<blockquote><p> Indeed Sandy does a clone of the original texture, for few reasons:<br />
- avoid an unfortunate dispose call.<br />
- allowing to have a setTransparency method to dynamically change the transparency without changing the original bitmapdata of the user.</p>
<p>Concerning the lock() and unclock() are you sure it has a performance impact?<br />
as far I know, this can’t provide any performance boost since the bitmapdata isn’t attached to the flash display list. When the object is out of stage, there’s no advantage to lock it.<br />
But I’d be interessted to have your feedback about that, and your performance test.</p></blockquote>
<p>About the BitmapData.clone(), he got his point.<br />
It just don&#8217;t work for me because I&#8217;m using too many 3d Objects with different BitmapMaterial for each, so, the system memory gets too high.<br />
But, about the setTransparency method, he is right.</p>
<p>About the lock and unlock methods, I runned a little benchmark test, because I got curious too how much performance boost you can get.<br />
Here&#8217;s the two test I made. (Clicking on the flash area it will re-run the benchmark test)</p>
<p>Using the lock and unlock methods.<br />

<object	type="application/x-shockwave-flash"
			data="/files/benchmark/20071203/bitmapLockBenchmark.swf"
			width="200"
			height="30">
	<param name="movie" value="/files/benchmark/20071203/bitmapLockBenchmark.swf" />
</object>
<p>Not using the lock and unlock methods.<br />

<object	type="application/x-shockwave-flash"
			data="/files/benchmark/20071203/noBitmapLockBenchmark.swf"
			width="200"
			height="30">
	<param name="movie" value="/files/benchmark/20071203/noBitmapLockBenchmark.swf" />
</object>
<p>It&#8217;s a really simple test, just to make a benchmark test.<br />
Actually, it&#8217;s not a situation that uses any 3d framework.</p>
<p>Creating a BitmapData.<br />
Creating 1000 Bitmaps.<br />
Applying 1000 times a BlurFilter over the BitmapData.</p>
<p>On my PC I get about 150ms faster with locking the BitmapData.</p>
<p>keita</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/feed/</wfw:commentRss>
		</item>
		<item>
		<title>BitmapMaterial tips</title>
		<link>http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/</link>
		<comments>http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 08:05:46 +0000</pubDate>
		<dc:creator>keita</dc:creator>
		
		<category><![CDATA[Sandy3d]]></category>

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

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

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

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

		<guid isPermaLink="false">http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/</guid>
		<description><![CDATA[I was making some experiments with Sandy3d and Papervision3d and I realized some tips to increase the performance.
Firstly, with Sandy3d 3.0, when you create a BitmapMaterial, the BitmapData that you used to create the Material, is cloned to create the BitmapMaterial.texture.
So, one think you can do is dispose the BitmapData that you used to create [...]]]></description>
			<content:encoded><![CDATA[<p>I was making some experiments with <a href="http://www.flashsandy.org/" target="_blank">Sandy3d</a> and <a href="http://blog.papervision3d.org" target="_blank">Papervision3d</a> and I realized some tips to increase the performance.</p>
<p>Firstly, with <a href="http://www.flashsandy.org/" target="_blank">Sandy3d</a> 3.0, when you create a BitmapMaterial, the BitmapData that you used to create the Material, is cloned to create the BitmapMaterial.texture.<br />
So, one think you can do is dispose the BitmapData that you used to create the Material after instantiating it and also, if you want to update your BitmapData use the BitmapMaterial.texture directly.</p>
<p>Something like this:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">var</span> bmpData:BitmapData = <span class="kw2">new</span> BitmapData<span class="br0">&#40;</span><span class="nu0">100</span>, <span class="nu0">100</span>, <span class="kw2">true</span>, 0&#215;00000000<span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> bmpMaterial:BitmapMaterial = <span class="kw2">new</span> BitmapMaterial<span class="br0">&#40;</span>bmpData<span class="br0">&#41;</span>;</p>
<p>bmpData.<span class="me1">dispose</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>bmpMaterial.<span class="me1">texture</span>.<span class="me1">fillRect</span><span class="br0">&#40;</span><span class="kw2">new</span> Rectangle<span class="br0">&#40;</span><span class="nu0">10</span>,<span class="nu0">10</span>,<span class="nu0">30</span>,<span class="nu0">30</span><span class="br0">&#41;</span>, 0xffff0000<span class="br0">&#41;</span>;</div>
</div>
<p>This will not work with Papervision3d because it uses the same BitmapData instance (in my opinion, smarter).</p>
<p>Now for both, <a href="http://www.flashsandy.org/" target="_blank">Sandy3d</a> and <a href="http://blog.papervision3d.org" target="_blank">Papervision3d</a>.<br />
As you make changes on your BitmapData, it&#8217;s updated on every poligon.<br />
So, use the BitmapData.lock() and BitmapData.unlock() when you are redrawing your BitmapData texture.</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">var</span> bmpData:BitmapData = <span class="kw2">new</span> BitmapData<span class="br0">&#40;</span><span class="nu0">100</span>, <span class="nu0">100</span>, <span class="kw2">false</span>, 0&#215;00000000<span class="br0">&#41;</span>;<br />
<span class="kw2">var</span> bmpMaterial:BitmapMaterial = <span class="kw2">new</span> BitmapMaterial<span class="br0">&#40;</span>bmpData<span class="br0">&#41;</span>;</p>
<p>redrawBitmap<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>&#8230;</p>
<p><span class="kw2">function</span> redrawBitmap<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></p>
<p>bmpData.<span class="me1">lock</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>bmpData.<span class="me1">fillRect</span><span class="br0">&#40;</span>bmpData.<span class="me1">rect</span>, 0&#215;00000000<span class="br0">&#41;</span>;<br />
bmpData.<span class="me1">fillRect</span><span class="br0">&#40;</span><span class="kw2">new</span> Rectangle<span class="br0">&#40;</span><span class="nu0">10</span>,<span class="nu0">10</span>,<span class="nu0">30</span>,<span class="nu0">30</span><span class="br0">&#41;</span>, 0xffff0000<span class="br0">&#41;</span>;</p>
<p><span class="kw2">var</span> blurFilter:BlurFilter = <span class="kw2">new</span> BlurFilter<span class="br0">&#40;</span><span class="nu0">16</span>, <span class="nu0">16</span>, <span class="nu0">3</span><span class="br0">&#41;</span>;</p>
<p>bmpData.<span class="me1">applyFilter</span><span class="br0">&#40;</span>bmpData, bmpData.<span class="me1">rect</span>, <span class="kw2">new</span> Point<span class="br0">&#40;</span><span class="nu0">0</span>,<span class="nu0">0</span><span class="br0">&#41;</span>, blurFilter<span class="br0">&#41;</span>;</p>
<p>bmpData.<span class="me1">unlock</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="br0">&#125;</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
