<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>labs.hellokeita.com &#187; Sandy3d</title>
	<atom:link href="http://labs.hellokeita.com/category/sandy3d/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.hellokeita.com</link>
	<description>Yet another labs blog</description>
	<lastBuildDate>Mon, 02 Aug 2010 11:20:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>LFPUG Presentation and Sources</title>
		<link>http://labs.hellokeita.com/2009/09/07/lfpug-presentation-and-sources/</link>
		<comments>http://labs.hellokeita.com/2009/09/07/lfpug-presentation-and-sources/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 10:01:56 +0000</pubDate>
		<dc:creator>keita</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash 10]]></category>
		<category><![CDATA[Flash CS4]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Komposer]]></category>
		<category><![CDATA[LFPUG]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[Sandy3d]]></category>
		<category><![CDATA[Sound]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[dynamic sound]]></category>

		<guid isPermaLink="false">http://labs.hellokeita.com/?p=85</guid>
		<description><![CDATA[As promissed, here is the presentation I made at LFPUG in PDF format.
http://www.hellokeita.in/presentations/LFPUG/20090827/MakingMusicFP10.pdf
And the source files zipped with the demos I showed.
http://www.hellokeita.in/presentations/LFPUG/20090827/examples.zip
The contents are:
Example01-SineWaveExample: Simple example generating a sine wave
Example02-KeyboardExample: Example of a piano keyboard
Example03-WaveformExample: Changing the waveform of a sound
Example04-TimePitchExample: Changing pitch and tempo of a mp3
Example05-HeliumBalloon: Real time pitch shifting using Java
Enjoy!
UPDATE
LFPUG website [...]]]></description>
			<content:encoded><![CDATA[<p>As promissed, here is the presentation I made at LFPUG in PDF format.</p>
<p><a href="http://www.hellokeita.in/presentations/LFPUG/20090827/MakingMusicFP10.pdf" target="_blank">http://www.hellokeita.in/presentations/LFPUG/20090827/MakingMusicFP10.pdf</a></p>
<p>And the source files zipped with the demos I showed.</p>
<p><a href="http://www.hellokeita.in/presentations/LFPUG/20090827/examples.zip" target="_blank">http://www.hellokeita.in/presentations/LFPUG/20090827/examples.zip</a><br />
The contents are:<br />
Example01-SineWaveExample: Simple example generating a sine wave<br />
Example02-KeyboardExample: Example of a piano keyboard<br />
Example03-WaveformExample: Changing the waveform of a sound<br />
Example04-TimePitchExample: Changing pitch and tempo of a mp3<br />
Example05-HeliumBalloon: Real time pitch shifting using Java</p>
<p>Enjoy!</p>
<p><font color="#FF0000">UPDATE</font><br />
LFPUG website uploaded the video of my presentation<br />
<a href="http://www.lfpug.com/flash-10-making-music/" target="_blank">http://www.lfpug.com/flash-10-making-music/</a></p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2009/09/07/lfpug-presentation-and-sources/&ztz=LFPUG Presentation and Sources'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2009/09/07/lfpug-presentation-and-sources/&ztz=LFPUG Presentation and Sources'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2009/09/07/lfpug-presentation-and-sources/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</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[3d]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[BitmapData]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Papervision3d]]></category>
		<category><![CDATA[Sandy3d]]></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 classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_20080213_654642461"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="/files/k3d/20080213.swf" />
	<param name="bgcolor" value="#ffffff" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/k3d/20080213.swf"
			name="fm_20080213_654642461"
			width="400"
			height="300">
		<param name="bgcolor" value="#ffffff" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2008/02/13/my-own-3d-engine/&ztz=My own 3d engine...'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2008/02/13/my-own-3d-engine/&ztz=My own 3d engine...'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2008/02/13/my-own-3d-engine/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</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[AS3]]></category>
		<category><![CDATA[Benchmark]]></category>
		<category><![CDATA[BitmapData]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Sandy3d]]></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 classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_bitmapLockBenchmark_1894816972"
			class="flashmovie"
			width="200"
			height="30">
	<param name="movie" value="/files/benchmark/20071203/bitmapLockBenchmark.swf" />
	<param name="bgcolor" value="#f9f9f9" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/benchmark/20071203/bitmapLockBenchmark.swf"
			name="fm_bitmapLockBenchmark_1894816972"
			width="200"
			height="30">
		<param name="bgcolor" value="#f9f9f9" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Not using the lock and unlock methods.<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_noBitmapLockBenchmark_1252212502"
			class="flashmovie"
			width="200"
			height="30">
	<param name="movie" value="/files/benchmark/20071203/noBitmapLockBenchmark.swf" />
	<param name="bgcolor" value="#f9f9f9" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/files/benchmark/20071203/noBitmapLockBenchmark.swf"
			name="fm_noBitmapLockBenchmark_1252212502"
			width="200"
			height="30">
		<param name="bgcolor" value="#f9f9f9" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</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>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/&ztz=BitmapData.lock benchmark'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/&ztz=BitmapData.lock benchmark'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/12/04/bitmapdatalock-benchmark/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</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[AS3]]></category>
		<category><![CDATA[BitmapData]]></category>
		<category><![CDATA[Papervision3d]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Sandy3d]]></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:<br />
[code lang="actionscript"]<br />
var bmpData:BitmapData = new BitmapData(100, 100, true, 0x00000000);<br />
var bmpMaterial:BitmapMaterial = new BitmapMaterial(bmpData);</p>
<p>bmpData.dispose();</p>
<p>bmpMaterial.texture.fillRect(new Rectangle(10,10,30,30), 0xffff0000);<br />
[/code]<br />
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>
<p>[code lang="actionscript"]<br />
var bmpData:BitmapData = new BitmapData(100, 100, false, 0x00000000);<br />
var bmpMaterial:BitmapMaterial = new BitmapMaterial(bmpData);</p>
<p>redrawBitmap();</p>
<p>...</p>
<p>function redrawBitmap(){</p>
<p>bmpData.lock();</p>
<p>bmpData.fillRect(bmpData.rect, 0x00000000);<br />
bmpData.fillRect(new Rectangle(10,10,30,30), 0xffff0000);</p>
<p>var blurFilter:BlurFilter = new BlurFilter(16, 16, 3);</p>
<p>bmpData.applyFilter(bmpData, bmpData.rect, new Point(0,0), blurFilter);</p>
<p>bmpData.unlock();</p>
<p>}<br />
[/code]</p>
<a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/&ztz=BitmapMaterial tips'><img src='http://labs.hellokeita.com/wp-content/plugins/hexosearch-button/logo16x16.png' width='16' height='16' border='0' style='padding:0px 5px 0px 0px;vertical-align:middle' alt='Vote in HexoSearch' title='Vote in HexoSearch' /></a> <span style='vertical-align:middle'><a href='http://www.hexosearch.com/se/submit.aspx?zlvz=2&zqz=&zurlz=http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/&ztz=BitmapMaterial tips'>Vote</a></span>]]></content:encoded>
			<wfw:commentRss>http://labs.hellokeita.com/2007/11/28/bitmapmaterial-tips/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
