<?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>Dalai Felinto</title>
	<atom:link href="http://www.dalaifelinto.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.dalaifelinto.com</link>
	<description>Blender, Domes and Dunno</description>
	<lastBuildDate>Sat, 19 May 2012 01:38:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Image of the week</title>
		<link>http://www.dalaifelinto.com/?p=459</link>
		<comments>http://www.dalaifelinto.com/?p=459#comments</comments>
		<pubDate>Sat, 19 May 2012 00:27:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blender]]></category>

		<guid isPermaLink="false">http://www.dalaifelinto.com/?p=459</guid>
		<description><![CDATA[Render with ARLuxrender (branch of luxrender). A small teaser from a paper I&#8217;m writing with Aldo Zang (arlux developer). Try to guess what is real and what is fake here &#160; &#160; Against all the odds the sofas are real (so far it seems that most people tend to think they are the 3d elements). The carpet [...]]]></description>
			<content:encoded><![CDATA[<p>Render with <a href="http://w3.impa.br/~zang/arlux">ARLuxrender</a> (branch of luxrender). A small teaser from a paper I&#8217;m writing with Aldo Zang (arlux developer). Try to guess what is real and what is fake here <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div id="attachment_463" class="wp-caption aligncenter" style="width: 559px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/05/carpet.jpg"><img class="size-full wp-image-463" title="carpet_550" src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/carpet_550.jpg" alt="" width="549" height="309" /></a><p class="wp-caption-text">Render of the week - Blender + luxrender (arlux)</p></div>
<p>&nbsp;</p>
<div id="attachment_461" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/05/coffee_panorama.jpg"><img class="size-full wp-image-461" title="Panorama" src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/coffee_panorama_550.jpg" alt="" width="550" height="275" /></a><p class="wp-caption-text">Background Plate + Lighting - captured environment</p></div>
<p>&nbsp;</p>
<p>Against all the odds the sofas are real (so far it seems that most people tend to think they are the 3d elements). The carpet is pure 3D though (well, based of a 2D image actually). The spheres are also 3d, but we have a lot of the scene elements modeled as &#8220;support meshes&#8221;. That&#8217;s how the spheres can get the right reflection and lighting.</p>
<p>Also can you see what the carpet is covering ?<br />
Ah, and this image has no post-processing or compositing on it. It comes blended with the real elements straight from the render.</p>
<p>Cheers,<br />
Dalai</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalaifelinto.com/?feed=rss2&#038;p=459</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IBL Toolkit &#8211; beta release</title>
		<link>http://www.dalaifelinto.com/?p=427</link>
		<comments>http://www.dalaifelinto.com/?p=427#comments</comments>
		<pubDate>Wed, 09 May 2012 16:42:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blender]]></category>
		<category><![CDATA[domes]]></category>

		<guid isPermaLink="false">http://www.dalaifelinto.com/?p=427</guid>
		<description><![CDATA[I&#8217;m writing an addon to help with scene reconstruction and lighting with IBL files. It also works as a handy workflow to expand panoramas with rendered elements. It&#8217;s still in its Beta version and I&#8217;m evaluating it in production only now, so things will likely change. However if you want to take a first glance at [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing an addon to help with scene reconstruction and lighting with IBL files. It also works as a handy workflow to expand panoramas with rendered elements.</p>
<p>It&#8217;s still in its Beta version and I&#8217;m evaluating it in production only now, so things will likely change.</p>
<div id="attachment_428" class="wp-caption aligncenter" style="width: 560px"><img class="size-full wp-image-428" title="arlux_blender1_550" src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/arlux_blender1_550.jpg" alt="" width="550" height="365" /><p class="wp-caption-text">quick render test</p></div>
<p>However if you want to take a first glance at it you will need:</p>
<ul>
<li> <a title="Blender Builder" href="http://builder.blender.org">Recent Blender</a> (after 2.63a)</li>
<li><a href="http://www.dalaifelinto.com/ftp/impa/ibl_toolkit.txt" target="_blank">Readme</a></li>
<li><a href="http://www.dalaifelinto.com/ftp/impa/ibl_toolkit_beta.zip" target="_blank">Download</a> (import as addon)</li>
</ul>
<p>Some screens:</p>
<div id="attachment_430" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/05/arlux_blender4.jpg"><img class="size-full wp-image-430 " title="arlux_blender4_550" src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/arlux_blender4_550.jpg" alt="" width="550" height="344" /></a><p class="wp-caption-text">blender, top right cycles rendering background, top left addon to add the background with glsl shader</p></div>
<div id="attachment_429" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/05/arlux_blender2.jpg"><img class="size-full wp-image-429" title="arlux_blender2_550" src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/arlux_blender2_550.jpg" alt="" width="550" height="344" /></a><p class="wp-caption-text">ARLuxrender at work</p></div>
<p><em>Note: my goal is to use arluxrender as the final renderer, but all the modelling and editing is to be done inside Blender.</em></p>
<p>The original teaser with old screenshots can be found here: <a href="http://www.dalaifelinto.com/?p=377" target="_blank">http://www.dalaifelinto.com/?p=377</a></p>
<p>For further discussions you can visit the <a href="http://blenderartists.org/forum/showthread.php?254500-IBL-Toolkit-Beta-(wip)-expanding-panoramas-with-rendered-elements&amp;p=2115875">Blender Artists forum thread</a> as well.</p>
<p>&nbsp;</p>
<p>If you do some real testing with it, please let me know your thoughts.</p>
<p>Dalai</p>
<p><em>Project developed with Aldo Zang at the <a href="http://visgraf.impa.br" target="_blank">Visgraf</a> lab</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalaifelinto.com/?feed=rss2&#038;p=427</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Photographic Fisheye lens in Blender (Cycles)</title>
		<link>http://www.dalaifelinto.com/?p=399</link>
		<comments>http://www.dalaifelinto.com/?p=399#comments</comments>
		<pubDate>Thu, 03 May 2012 14:54:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[arquitetura]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[domes]]></category>
		<category><![CDATA[fisheye]]></category>

		<guid isPermaLink="false">http://www.dalaifelinto.com/?p=399</guid>
		<description><![CDATA[Not only of domes can an artist leave of. The fisheye mode shown in the previous post is sufficient for planetarium productions, but may not satisfy artists looking for &#8216;real&#8217; fisheye lens. The most common lens found in today&#8217;s market are &#8216;equisolid&#8217; lens (ref: HDRI for CGI). After a productive holiday we now have something new [...]]]></description>
			<content:encoded><![CDATA[<p>Not only of domes can an artist leave of. The fisheye mode shown in the <a href="http://www.dalaifelinto.com/?p=389">previous post </a>is sufficient for planetarium productions, but may not satisfy artists looking for &#8216;real&#8217; fisheye lens. The most common lens found in today&#8217;s market are &#8216;equisolid&#8217; lens (ref: <a href="http://www.hdrlabs.com/tutorials/downloads_files/HDRI%20for%20CGI.pdf">HDRI for CGI</a>).</p>
<p>After a productive holiday we now have something new to play with <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div id="attachment_401" class="wp-caption aligncenter" style="width: 540px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/05/cycles_fisheye_jay1.jpg"><img class="size-full wp-image-401" title="cycles_fisheye_jay1_550" src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/cycles_fisheye_jay1_550.jpg" alt="" width="530" height="352" /></a><p class="wp-caption-text">model by Jar-Artist</p></div>
<div id="attachment_401" class="wp-caption aligncenter" style="width: 540px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/05/cycles_fisheye_jay2.jpg"><img class="aligncenter size-full wp-image-403" title="cycles_fisheye_jay2_550" src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/cycles_fisheye_jay2_550.jpg" alt="" width="530" height="352" /></a><p class="wp-caption-text">model by Jar-Artist</p></div>
<p>Models/scene gently provided by Jar-Artist<br />
<a href="http://www.blendswap.com/blends/author/jay-artist/"> http://www.blendswap.com/blends/author/jay-artist/</a></p>
<p>&nbsp;</p>
<h2>The proof is in the pudin</h2>
<p>It&#8217;s &#8220;easy&#8221; to put up a nice artistic effect together and simply assume everything is working as it should. However, I wanted to make a system that could match the effect produced by real lens. For that I had to build a fail proof experiment. People not into coding may not know, but building a reliable testing and debugging setup is one of the keys for efficient coding. In my opinion it&#8217;s always worthy to put time into this. <strong>Note: this is also why Blender users can help a lot with bug fixing by simply building proper test files for the (also carefully/methodologically) reported bugs).</strong></p>
<h3>1 &#8211; Photoshooting</h3>
<p>Take some pictures with a tripod rotating the camera on its center (the focal centre actually). We have been doing this for the past two weeks so it was smooth. Those pictures were taken by <a href="http://w3.impa.br/~zang/">Aldo Zang</a> in the <a href="http://www.visgraf.impa.br/">Visgraf Lab</a> at <a href="http://www.impa.br">IMPA</a>.</p>
<p><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/05/hugin.jpg"><img class="aligncenter size-full wp-image-408" title="5 photos + zenith + nadir into Hugin" src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/hugin_550.jpg" alt="" width="550" height="484" /></a></p>
<h3>2 &#8211; Stiching</h3>
<p>I don&#8217;t get tired of recommending <a href="http://hugin.sourceforge.net">Hugin</a> for stitching and panorama making &#8211; <a href="http://hugin.sourceforge.net">hugin.sourceforge.net</a>. This open source project sometimes works better even than autopano pro (a pretty good commercial alternative).</p>
<p><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/05/panorama.jpg"><img class="aligncenter size-full wp-image-406" title="" src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/panorama_550.jpg" alt="" width="550" height="275" /></a></p>
<p>&nbsp;</p>
<h3>3 &#8211; Rendering</h3>
<p>I put the panorama as a background plate, calibrated the aligment, added a simple floor + spheres. This was done with the (yet to be released) <a title="IBL Toolkit explained" href="http://lists.blender.org/pipermail/bf-vfx/2012-April/000300.html">IBL Toolkit</a>. Apart from that my Blender camera needs to match the settings of the real camera+lens I&#8217;m aiming at.</p>
<p><img class="aligncenter size-full wp-image-413" title="Interface" src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/ui.png" alt="" width="550" height="382" /></p>
<p>In this case all the pictures for the stitching were taken with a Nikon DX2S and a fisheye 10.5mm lens. I created new presets for the sensor dimensions and the render output.</p>
<h3>4 &#8211; Results</h3>
<p>I was quite pleased when I compared the rendered output with the original image. The aspects we should be looking at are only <a href="http://www.bobatkins.com/photography/technical/field_of_view.html">field of view</a> and line distortion across the lens:</p>
<p><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/05/side_comparison_550.jpg"><img class="aligncenter size-full wp-image-404" title="Left: photo - right photo to " src="http://www.dalaifelinto.com/wp-content/uploads/2012/05/side_comparison_550.jpg" alt="" width="550" height="414" /></a></p>
<p>&nbsp;</p>
<p>Also note the bottom left corner of the photo. This subtle shadowing is due to the vignetting of the lens. This is not present in the cycles render because I&#8217;m not implementing a real camera model (<a href="https://graphics.stanford.edu/wikis/cs348b-11/Assignment3">as shown here</a> and <a title="A Realistic Camera Model for Computer Graphics" href="http://www.graphics.stanford.edu/papers/camera/">here</a>).</p>
<h2>Algorithm</h2>
<p>The complete patch can be found <a href="http://dalaifelinto.com/ftp/cycles_fisheye.diff">here</a>. The core is the following function (simplified here). I elaborated this from the &#8216;classic&#8217; fisheye equisolid formula: <strong>radius = 2 * focallens * sin ( angle / 2)</strong>:</p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">__device float3 fisheye_equisolid_to_direction<span style="color: #008000;">&#40;</span><br />
<span style="color: #0000ff;">float</span> u, <span style="color: #0000ff;">float</span> v, <span style="color: #0000ff;">float</span> lens, <span style="color: #0000ff;">float</span> width, <span style="color: #0000ff;">float</span> height<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; u <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>u <span style="color: #000040;">-</span> <span style="color:#800080;">0.5</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> width<span style="color: #008080;">;</span><br />
&nbsp; &nbsp; v <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>v <span style="color: #000040;">-</span> <span style="color:#800080;">0.5</span><span style="color: #008000;">&#41;</span> <span style="color: #000040;">*</span> height<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">float</span> r <span style="color: #000080;">=</span> <span style="color: #0000dd;">sqrt</span><span style="color: #008000;">&#40;</span>u<span style="color: #000040;">*</span>u <span style="color: #000040;">+</span> v<span style="color: #000040;">*</span>v<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">float</span> phi <span style="color: #000080;">=</span> <span style="color: #0000dd;">acos</span><span style="color: #008000;">&#40;</span>u<span style="color: #000040;">/</span>r<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">float</span> theta <span style="color: #000080;">=</span> <span style="color: #0000dd;">2</span> <span style="color: #000040;">*</span> <span style="color: #0000dd;">asin</span><span style="color: #008000;">&#40;</span>r<span style="color: #000040;">/</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">2</span> <span style="color: #000040;">*</span> lens<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>v <span style="color: #000080;">&lt;</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span> phi <span style="color: #000080;">=</span> <span style="color: #000040;">-</span>phi<span style="color: #008080;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> make_float3<span style="color: #008000;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000dd;">cos</span><span style="color: #008000;">&#40;</span>theta<span style="color: #008000;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000040;">-</span><span style="color: #0000dd;">cos</span><span style="color: #008000;">&#40;</span>phi<span style="color: #008000;">&#41;</span><span style="color: #000040;">*</span><span style="color: #0000dd;">sin</span><span style="color: #008000;">&#40;</span>theta<span style="color: #008000;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000dd;">sin</span><span style="color: #008000;">&#40;</span>phi<span style="color: #008000;">&#41;</span><span style="color: #000040;">*</span><span style="color: #0000dd;">sin</span><span style="color: #008000;">&#40;</span>theta<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#41;</span></div></div>
<p>I hope you like it. If you can share any work you did with this feature I would love to see it.<br />
Dalai</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalaifelinto.com/?feed=rss2&#038;p=399</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Fisheye in Cycles, yes we can !</title>
		<link>http://www.dalaifelinto.com/?p=389</link>
		<comments>http://www.dalaifelinto.com/?p=389#comments</comments>
		<pubDate>Tue, 24 Apr 2012 03:18:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blender]]></category>
		<category><![CDATA[domes]]></category>
		<category><![CDATA[programação]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://www.dalaifelinto.com/?p=389</guid>
		<description><![CDATA[What if we could render fisheye images directly from Blender? Yesterday I found out about the Equirectangular mode in Cycles. It got me quite thrilled (it&#8217;s been awhile since I was waiting for that). This is only possible because Cycles is a full ray tracer render engine. Every pixel in the image is generated from [...]]]></description>
			<content:encoded><![CDATA[<p>What if we could render fisheye images directly from Blender? Yesterday I found out about the Equirectangular mode in Cycles. It got me quite thrilled (it&#8217;s been awhile since I was waiting for that).</p>
<p>This is only possible because Cycles is a full ray tracer render engine. Every pixel in the image is generated from a ray coming from the camera to anywhere in the scene. Enough talking. A quick hack in the code and tcharan:</p>
<p>&nbsp;</p>
<div id="attachment_391" class="wp-caption aligncenter" style="width: 560px"><img class="size-full wp-image-391" title="Cycles Fisheye" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/cycles_fisheye.jpg" alt="" width="550" height="550" /><p class="wp-caption-text">IBL background plate + ibl toolkit (alignment addon) + cycles &#39;use panorama&#39; + fisheye patch</p></div>
<p>And the nice thing is, it previews in 3D just as well:</p>
<p><img class="aligncenter size-full wp-image-390" title="Cycles Fisheye 3D View" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/cycles_fisheye_3dview.jpg" alt="" width="550" height="313" /></p>
<p>What comes next? I will talk with Brecht to see if there is any pending design to have this implemented as another camera option. I would like to have an option to set the angle (so we don&#8217;t need to do only 180 degrees fisheyes). And to toggle between <a title="Fisheye modes" href="http://paulbourke.net/miscellaneous/domefisheye/fisheye/">hemispherical and angular fisheye modes</a>.</p>
<p>I you compile your own Blender and want to try the patch, get it <a href="http://www.dalaifelinto.com/ftp/fisheye.diff">here</a> or:</p>
<div class="codecolorer-container diff default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="diff codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Index: intern/cycles/kernel/kernel_montecarlo.h<br />
===================================================================<br />
<span style="color: #888822;">--- intern/cycles/kernel/kernel_montecarlo.h&nbsp; &nbsp; <span style="">&#40;</span>revision 45899<span style="">&#41;</span></span><br />
<span style="color: #888822;">+++ intern/cycles/kernel/kernel_montecarlo.h&nbsp; &nbsp; <span style="">&#40;</span>working copy<span style="">&#41;</span></span><br />
<span style="color: #440088;">@@ -215,13 +215,29 @@</span><br />
&nbsp;<br />
&nbsp;__device float3 equirectangular_to_direction<span style="">&#40;</span>float u, float v<span style="">&#41;</span><br />
&nbsp;<span style="">&#123;</span><br />
<span style="color: #00b000;">+ &nbsp; u = <span style="">&#40;</span>u - 0.5f<span style="">&#41;</span> * <span style="">2</span>.f;</span><br />
<span style="color: #00b000;">+ &nbsp; v = <span style="">&#40;</span>v - 0.5f<span style="">&#41;</span> * <span style="">2</span>.f;</span><br />
<span style="color: #00b000;">+</span><br />
<span style="color: #00b000;">+ &nbsp; float r = sqrt<span style="">&#40;</span>u*u + v*v<span style="">&#41;</span>;</span><br />
<span style="color: #00b000;">+ &nbsp; float theta = acosf<span style="">&#40;</span>u/r<span style="">&#41;</span>;</span><br />
<span style="color: #00b000;">+</span><br />
<span style="color: #00b000;">+ &nbsp; if <span style="">&#40;</span>v &lt; <span style="">0</span>.f<span style="">&#41;</span> theta = -theta;</span><br />
<span style="color: #00b000;">+</span><br />
<span style="color: #00b000;">+ &nbsp; return make_float3<span style="">&#40;</span></span><br />
<span style="color: #00b000;">+ &nbsp; &nbsp; &nbsp; sqrtf<span style="">&#40;</span><span style="">&#40;</span>1.f - r*r<span style="">&#41;</span><span style="">&#41;</span>,</span><br />
<span style="color: #00b000;">+ &nbsp; &nbsp; &nbsp; -cosf<span style="">&#40;</span>theta<span style="">&#41;</span>*r,</span><br />
<span style="color: #00b000;">+ &nbsp; &nbsp; &nbsp; sinf<span style="">&#40;</span>theta<span style="">&#41;</span>*r</span><br />
<span style="color: #00b000;">+ &nbsp; <span style="">&#41;</span>;</span><br />
<span style="color: #00b000;">+</span><br />
<span style="color: #00b000;">+</span><br />
<span style="color: #00b000;">+/*</span><br />
&nbsp; &nbsp; float phi = M_PI_F*<span style="">&#40;</span>1.0f - 2.0f*u<span style="">&#41;</span>;<br />
&nbsp; &nbsp; float theta = M_PI_F*<span style="">&#40;</span>1.0f - v<span style="">&#41;</span>;<br />
<span style="color: #991111;">-</span><br />
&nbsp; &nbsp; return make_float3<span style="">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; sin<span style="">&#40;</span>theta<span style="">&#41;</span>*cos<span style="">&#40;</span>phi<span style="">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; sin<span style="">&#40;</span>theta<span style="">&#41;</span>*sin<span style="">&#40;</span>phi<span style="">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; cos<span style="">&#40;</span>theta<span style="">&#41;</span><span style="">&#41;</span>;<br />
<span style="color: #00b000;">+*/</span><br />
&nbsp;<span style="">&#125;</span><br />
&nbsp;<br />
&nbsp;/* Mirror Ball &lt;-&gt; Cartesion direction */</div></div>
<p>&nbsp;</p>
<p>&#8211;<br />
Dalai<br />
* IBL from <a href="http://www.hdrlabs.com/sibl/archive.html" title="HDR Labs">HDR Labs</a><br />
* IBL Toolkit explained <a href="http://lists.blender.org/pipermail/bf-vfx/2012-April/000300.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalaifelinto.com/?feed=rss2&#038;p=389</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>IBL Toolkit &#8211; Teaser</title>
		<link>http://www.dalaifelinto.com/?p=377</link>
		<comments>http://www.dalaifelinto.com/?p=377#comments</comments>
		<pubDate>Fri, 13 Apr 2012 22:12:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blender]]></category>
		<category><![CDATA[composite nodes]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[programação]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://www.dalaifelinto.com/?p=377</guid>
		<description><![CDATA[There is a new addon landing. If you work with IBL in Blender for modeling come by soon. In the mean time enjoy the teaser (or poke me to provide some feedback and perhaps even join the alpha testing period). Ideas, questions, comments, feel free to drop a line]]></description>
			<content:encoded><![CDATA[<p>There is a new addon landing. If you work with IBL in Blender for modeling come by soon. In the mean time enjoy the teaser (or poke me to provide some feedback and perhaps even join the alpha testing period).</p>
<div id="attachment_379" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/ibl_1.jpg"><img class=" wp-image-379" title="IBL - Japanese Subway - www.hdrlabs.com/sibl/archive.html" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/ibl_1_550.jpg" alt="" width="550" height="344" /></a><p class="wp-caption-text">IBL autosetup for Cycles and Luxrender</p></div>
<div id="attachment_383" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/ibl_3.jpg"><img class=" wp-image-383 " title="IBL Japanese subway 2 - www.hdrlabs.com/sibl/archive.html" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/ibl_3_550.jpg" alt="" width="550" height="344" /></a><p class="wp-caption-text">IBL Re-Aligment</p></div>
<div id="attachment_381" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/ibl_2.jpg"><img class=" wp-image-381" title="IBL - IMPA - made with fishey camera + Hugin" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/ibl_2_550.jpg" alt="" width="550" height="344" /></a><p class="wp-caption-text">Home made panoramas also work <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p></div>
<div id="attachment_385" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/ibl_4.jpg"><img class=" wp-image-385" title="IBL IMPA - made with fisheye" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/ibl_4_550.jpg" alt="" width="550" height="344" /></a><p class="wp-caption-text">Point projection for calibration tweaking</p></div>
<p>Ideas, questions, comments, feel free to drop a line <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalaifelinto.com/?feed=rss2&#038;p=377</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Subdividing Sphere Wannabe Meshes</title>
		<link>http://www.dalaifelinto.com/?p=314</link>
		<comments>http://www.dalaifelinto.com/?p=314#comments</comments>
		<pubDate>Tue, 10 Apr 2012 06:56:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[outros]]></category>
		<category><![CDATA[programação]]></category>

		<guid isPermaLink="false">http://www.dalaifelinto.com/?p=314</guid>
		<description><![CDATA[This post is my presentation for the &#8220;Geometry Processing&#8221; course I&#8217;m attending in IMPA, the National Institute of Pure and Applied Math in Rio de Janeiro, Brazil. http://lhf.impa.br/cursos/pg/ The course is ministred by the professors: Luiz Henrique de Figueiredo Luiz Velho What&#8217;s up doc? The problem proposed was to create an algorithm to subdivide a [...]]]></description>
			<content:encoded><![CDATA[<p>This post is my presentation for the &#8220;Geometry Processing&#8221; course I&#8217;m attending in IMPA, the National Institute of Pure and Applied Math in Rio de Janeiro, Brazil. <a href="http://lhf.impa.br/cursos/pg/">http://lhf.impa.br/cursos/pg/</a></p>
<p><img src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/icosahedron_bw_inv.jpg" alt="" title="icosahedron_bw_inv" width="550" height="137" class="aligncenter size-full wp-image-351" /></p>
<p>The course is ministred by the professors:<br />
<a href="http://www.impa.br/~lhf/" title="Luiz Henrique de Figueiredo">Luiz Henrique de Figueiredo</a><br />
<a href="http://www.impa.br/~lvelho/" title="Luiz Velho">Luiz Velho</a></p>
<h3><u>What&#8217;s up doc?</u></h3>
<p>The problem proposed was to create an algorithm to subdivide a triangular mesh inscripted in a sphere (e.g. an icosahedron) multiple times in order to approximate the mesh to a complete sphere. We need to solve two different mesh structures:</p>
<ul>
<li>STL-like files &#8211; where triangles are listed by the coordinates of their vertices.</li>
<li><a href="http://www.geomview.org/docs/html/OFF.html">OFF</a>-like files &#8211; where triangles are listed by the indices of their vertices, and the vertices are listed by their coordinates.</li>
</ul>
<p><strong>I&#8217;m using only .ply files for both approaches. If you choice -m stl and the faces are indexed, they are internally converted to a storage format that treat them as OFF files.</strong></p>
<p>The delivery of the project is the following program/script. It requires python to be installed in the computer.</p>
<h3><u>How to run it</u></h3>
<p>1.1) Download the final script here &#8211; <a href="http://www.dalaifelinto.com/ftp/impa/subdivider.zip">subdivider.zip</a><br />
1.2) Download a sample ply file: <a href="http://www.dalaifelinto.com/ftp/impa/icosahedron.ply" title="Icosahedron">icosahedron.ply</a>.</p>
<p>2) Unzip and run the command:<br />
<strong>./subdivider.py icosahedron.ply -l 5 -m ply -o icosahedron_5.ply</strong><br />
* in MS Windows you need to call it with the python console or set it to automatically run using the Python installation available.<br />
* if you want to force the program to use the stl method use <strong>-m stl</strong> in the arguments.</p>
<p>3) The output file is ready. You can check the result in <a href="http://www.blender.org">Blender</a> or <a href="http://meshlab.sourceforge.net/">MeshLab</a><br />
<a href="http://www.dalaifelinto.com/ftp/impa/icosahedron_stl_5.ply.zip">STL output file</a> | <a href="http://www.dalaifelinto.com/ftp/impa/icosahedron_5.ply.zip">PLY output file</a></p>
<p><strong>For the rest of this document I&#8217;m explaining only the &#8216;off&#8217; (ply actually) approach. The &#8216;stl&#8217; one is more a warm up, given that it&#8217;s no challenge compared to what comes next. Both algorithms can be found in the complete script above.</strong></p>
<h3><u>Result and performance</u></h3>
<div id="attachment_352" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/icosahedron.png"><img src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/icosahedron.png" alt="" title="icosahedron" width="550" height="137" class="size-full wp-image-352" /></a><p class="wp-caption-text">Result rendered in Blender, levels 0, 1, 2, 3 and 4</p></div>
<p>
<strong><br />
<h4>Performance Comparison</h4>
<p></strong></p>
<table>
<tr>
<td><strong>Subdivision</strong></td>
<td><strong>Python</strong></td>
<td><a href="http//www.pypy.org" title="PyPy"><strong>PyPy</strong></a></td>
</tr>
<tr>
<td>level 1 </td>
<td> 0.0001</td>
<td>0.0002   </td>
</tr>
<tr>
<td>level 2 </td>
<td> 0.0003</td>
<td>0.0005   </td>
</tr>
<tr>
<td>level 3 </td>
<td> 0.0011</td>
<td>0.0019   </td>
</tr>
<tr>
<td>level 4 </td>
<td> 0.0046</td>
<td>0.0074   </td>
</tr>
<tr>
<td>level 5 </td>
<td> 0.0186</td>
<td>0.0881   </td>
</tr>
<tr>
<td>level 6 </td>
<td> 0.0746</td>
<td>0.2395   </td>
</tr>
<tr>
<td>level 7 </td>
<td> 0.3336</td>
<td>0.2790   </td>
</tr>
<tr>
<td>level 8 </td>
<td> 1.5101</td>
<td>0.8054   </td>
</tr>
<tr>
<td>level 9 </td>
<td> 6.6167</td>
<td>3.0026   </td>
</tr>
<tr>
<td>level 10</td>
<td> <N/A> &#8211; out of  memory</td>
<td>11.3281 </td>
</tr>
</table>
<p>Without any changes in the code, the execution with PyPy showed an improvement of 100%. It still doesn&#8217;t compare to native/compiled code, but those are satisfactory results given the simplicity of the implementation and the flexibility of using a script language.</p>
<h3><u>Rational</u></h3>
<p>The core of the code is the subdivision algorithm. I decided to look for a solution where a face could be seen as as much independent as possible. That means no pointer to neighbour triangles and no need to navigate in the triangles in a fancy particular order. The key I pursued is to create unique indices in a &#8216;universal&#8217; way. A system that could be used by neighbour triangles unaware of each other and that could result in the same values. </p>
<p>This may not be the most efficient algorithm, but it&#8217;s very simple to implement (the code in Python ended very compact).</p>
<h3><u>Code overview</u></h3>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># 1) parse args</span><br />
&nbsp; &nbsp; <span style="color: #008000;">input</span><span style="color: #66cc66;">,</span> output<span style="color: #66cc66;">,</span> method<span style="color: #66cc66;">,</span>level <span style="color: #66cc66;">=</span> parse_args<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># 2) import ply</span><br />
&nbsp; &nbsp; raw_verts<span style="color: #66cc66;">,</span> raw_faces <span style="color: #66cc66;">=</span> import_ply<span style="color: black;">&#40;</span><span style="color: #008000;">input</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># 3) convert to internal structure</span><br />
&nbsp; &nbsp; verts<span style="color: #66cc66;">,</span> faces <span style="color: #66cc66;">=</span> convert<span style="color: black;">&#40;</span>raw_verts<span style="color: #66cc66;">,</span> raw_faces<span style="color: #66cc66;">,</span> method<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># 4) subvidide</span><br />
&nbsp; &nbsp; verts<span style="color: #66cc66;">,</span> faces <span style="color: #66cc66;">=</span> subdivide<span style="color: black;">&#40;</span>verts<span style="color: #66cc66;">,</span> faces<span style="color: #66cc66;">,</span> level<span style="color: #66cc66;">,</span> method<span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># 5) export ply</span><br />
&nbsp; &nbsp; export_ply<span style="color: black;">&#40;</span>output<span style="color: #66cc66;">,</span> verts<span style="color: #66cc66;">,</span> faces<span style="color: black;">&#41;</span></div></div>
<p>Apart from the subdivision, they are other small steps needed: (1) parse the arguments (level, method, file, &#8230;); (2) import the ply file; (3) convert the raw data into an internal structure (more on that soon); (4) subdivide; (5) dump the new data into another ply file.</p>
<p>The conversion (3) rearrange the faces to store not only the vertices indices but also the indices of the edges. It&#8217;s a simple code that creates a key for a pair of vertex indices that will always return the same regardless of their order:<br />
<code class="codecolorer python default"><span class="python">key <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;%020d%020d&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #008000;">min</span><span style="color: black;">&#40;</span>v1<span style="color: #66cc66;">,</span>v2<span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #008000;">max</span><span style="color: black;">&#40;</span>v1<span style="color: #66cc66;">,</span>v2<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></span></code>.</p>
<p>If the key was already created we get the id from a dictionary. Otherwise creates a new id and assign it to this key.</p>
<h3><u>Subdivision code explanation</u></h3>
<p><em>* take a look at the code in the end of this page, or in the download link in the top.</em></p>
<p>First I allocate new vertices in the verts array. We are going to create one vertex per edge, thus we know from beginning the size of the new array. With the array pre-created it&#8217;s easy to see if a specific vertex has been created (by the other triangle that shares this edge) or if it needs to be initialized in the list.</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">verts.<span style="color: black;">extend</span><span style="color: black;">&#40;</span><span style="color: #008000;">list</span><span style="color: black;">&#40;</span><span style="color: #008000;">None</span> <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>old_edges<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></div>
<p>Next I create a unique vertex index that can be guessed/retrieved from both triangles that share the edge where the vertex is generated. Taking advantage of the fact that the number of new vertices is the same as the number of edges in the previous interaction, I use the edge index to directly assign a value for the vertex. <strong>old_verts</strong> works as an offset to the new vertices indices.</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">old_verts <span style="color: #66cc66;">=</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>verts<span style="color: black;">&#41;</span><br />
<br />
<span style="color: #808080; font-style: italic;"># new vertex indices</span><br />
v4 <span style="color: #66cc66;">=</span> old_verts + ea<br />
v5 <span style="color: #66cc66;">=</span> old_verts + eb<br />
v6 <span style="color: #66cc66;">=</span> old_verts + ec</div></div>
<p>Now that we know the exactly id of the vertex, we can see if it was created already. There is no risk of array overflow since the new verts array was already expanded to accommodate all the vertices (filled with None objects).</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># add new vertex only if non-existent</span><br />
<span style="color: #ff7700;font-weight:bold;">if</span> verts<span style="color: black;">&#91;</span>v4<span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #008000;">None</span>:<br />
&nbsp; &nbsp; verts<span style="color: black;">&#91;</span>v4<span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: black;">&#40;</span>verts<span style="color: black;">&#91;</span>v2<span style="color: black;">&#93;</span>+verts<span style="color: black;">&#91;</span>v3<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>.<span style="color: black;">normalize</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></div>
<p>For the new edges, 6 are external and come from the existent edges. It&#8217;s crucial to also find a unique index for them. My first attempt was to use an orientation system, always naming the edges clock-wise. This is not reliable though, I found it impossible to implement correctly. The final solution was to name an edge based on its opposite vertex. For example, in the initial triangle the <strong>vertex 1</strong> faces the <strong>edge 1</strong>, the <strong>vertex 2</strong> faces the <strong>edge 2</strong> and the <strong>vertex 3</strong> faces the <strong>edge 3</strong>.</p>
<p>Also part of the challenge is to split the edge in two new edges with universal indices. I used arbitrary comparison (vertex a > vertex b) to determine which edge will inherit the original index of the edge, and which one will be allocated passed the initial edge offset (<strong>old_edges</strong>):</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># new external edges</span><br />
e1 <span style="color: #66cc66;">=</span> ea + <span style="color: black;">&#40;</span>old_edges <span style="color: #ff7700;font-weight:bold;">if</span> v2 <span style="color: #66cc66;">&gt;</span> v3 <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span><br />
e4 <span style="color: #66cc66;">=</span> ea + <span style="color: black;">&#40;</span>old_edges <span style="color: #ff7700;font-weight:bold;">if</span> v2 <span style="color: #66cc66;">&lt;</span> v3 <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span></div></div>
<p>The internal edges (edge 7, 8 and 9) are brand new and all they need is to get an index from the edge pile and increment the counter. This is the equivalent in C for e7 = edge_inc ++. <strong>edge_inc</strong> is initialized as an offset to avoid overriding of edge indices.</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;"># new internal edges</span><br />
e7 <span style="color: #66cc66;">=</span> edge_inc<span style="color: #66cc66;">;</span> edge_inc +<span style="color: #66cc66;">=</span> <span style="color: #ff4500;">1</span></div></div>
<p>Finally it&#8217;s time to create the faces following the original schema.<br />
<div id="attachment_369" class="wp-caption aligncenter" style="width: 560px"><img src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/triangle.jpg" alt="" title="triangle" width="550" height="245" class="size-full wp-image-369" /><p class="wp-caption-text">new vertices and edges</p></div></p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">new_faces.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span> v1<span style="color: #66cc66;">,</span> v6<span style="color: #66cc66;">,</span> v5<span style="color: #66cc66;">,</span> e7<span style="color: #66cc66;">,</span> e5<span style="color: #66cc66;">,</span> e3<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
new_faces.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span> v6<span style="color: #66cc66;">,</span> v2<span style="color: #66cc66;">,</span> v4<span style="color: #66cc66;">,</span> e1<span style="color: #66cc66;">,</span> e8<span style="color: #66cc66;">,</span> e6<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
new_faces.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span> v5<span style="color: #66cc66;">,</span> v4<span style="color: #66cc66;">,</span> v3<span style="color: #66cc66;">,</span> e4<span style="color: #66cc66;">,</span> e2<span style="color: #66cc66;">,</span> e9<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
new_faces.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span> v6<span style="color: #66cc66;">,</span> v4<span style="color: #66cc66;">,</span> v5<span style="color: #66cc66;">,</span> e9<span style="color: #66cc66;">,</span> e7<span style="color: #66cc66;">,</span> e8<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></div>
<h3><u>Subdivision code-snippet</u></h3>
<p>The complete code of the subdivision can be seen here:</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">def</span> subdivide_ply<span style="color: black;">&#40;</span>verts<span style="color: #66cc66;">,</span> faces<span style="color: #66cc66;">,</span> level<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>level<span style="color: black;">&#41;</span>:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; old_verts <span style="color: #66cc66;">=</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>verts<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; old_edges <span style="color: #66cc66;">=</span> <span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>faces<span style="color: black;">&#41;</span> * <span style="color: #ff4500;">1.5</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; edge_inc <span style="color: #66cc66;">=</span> old_edges * <span style="color: #ff4500;">2</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; verts.<span style="color: black;">extend</span><span style="color: black;">&#40;</span><span style="color: #008000;">list</span><span style="color: black;">&#40;</span><span style="color: #008000;">None</span> <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>old_edges<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; new_faces <span style="color: #66cc66;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> v1<span style="color: #66cc66;">,</span> v2<span style="color: #66cc66;">,</span> v3<span style="color: #66cc66;">,</span> ea<span style="color: #66cc66;">,</span> eb<span style="color: #66cc66;">,</span> ec <span style="color: #ff7700;font-weight:bold;">in</span> faces:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># new vertex indices</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v4 <span style="color: #66cc66;">=</span> old_verts + ea<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v5 <span style="color: #66cc66;">=</span> old_verts + eb<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v6 <span style="color: #66cc66;">=</span> old_verts + ec<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># add new vertex only if non-existent</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> verts<span style="color: black;">&#91;</span>v4<span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #008000;">None</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; verts<span style="color: black;">&#91;</span>v4<span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: black;">&#40;</span>verts<span style="color: black;">&#91;</span>v2<span style="color: black;">&#93;</span>+verts<span style="color: black;">&#91;</span>v3<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>.<span style="color: black;">normalize</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> verts<span style="color: black;">&#91;</span>v5<span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #008000;">None</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; verts<span style="color: black;">&#91;</span>v5<span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: black;">&#40;</span>verts<span style="color: black;">&#91;</span>v3<span style="color: black;">&#93;</span>+verts<span style="color: black;">&#91;</span>v1<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>.<span style="color: black;">normalize</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> verts<span style="color: black;">&#91;</span>v6<span style="color: black;">&#93;</span> <span style="color: #66cc66;">==</span> <span style="color: #008000;">None</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; verts<span style="color: black;">&#91;</span>v6<span style="color: black;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: black;">&#40;</span>verts<span style="color: black;">&#91;</span>v1<span style="color: black;">&#93;</span>+verts<span style="color: black;">&#91;</span>v2<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>.<span style="color: black;">normalize</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># note, the following could be 'optmized' to run the</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># if only once . the gain is of 3%</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># new external edges</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e1 <span style="color: #66cc66;">=</span> ea + <span style="color: black;">&#40;</span>old_edges <span style="color: #ff7700;font-weight:bold;">if</span> v2 <span style="color: #66cc66;">&gt;</span> v3 <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e4 <span style="color: #66cc66;">=</span> ea + <span style="color: black;">&#40;</span>old_edges <span style="color: #ff7700;font-weight:bold;">if</span> v2 <span style="color: #66cc66;">&lt;</span> v3 <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e2 <span style="color: #66cc66;">=</span> eb + <span style="color: black;">&#40;</span>old_edges <span style="color: #ff7700;font-weight:bold;">if</span> v3 <span style="color: #66cc66;">&gt;</span> v1 <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e5 <span style="color: #66cc66;">=</span> eb + <span style="color: black;">&#40;</span>old_edges <span style="color: #ff7700;font-weight:bold;">if</span> v3 <span style="color: #66cc66;">&lt;</span> v1 <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e3 <span style="color: #66cc66;">=</span> ec + <span style="color: black;">&#40;</span>old_edges <span style="color: #ff7700;font-weight:bold;">if</span> v1 <span style="color: #66cc66;">&gt;</span> v2 <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e6 <span style="color: #66cc66;">=</span> ec + <span style="color: black;">&#40;</span>old_edges <span style="color: #ff7700;font-weight:bold;">if</span> v1 <span style="color: #66cc66;">&lt;</span> v2 <span style="color: #ff7700;font-weight:bold;">else</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># new internal edges</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e7 <span style="color: #66cc66;">=</span> edge_inc<span style="color: #66cc66;">;</span> edge_inc +<span style="color: #66cc66;">=</span> <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e8 <span style="color: #66cc66;">=</span> edge_inc<span style="color: #66cc66;">;</span> edge_inc +<span style="color: #66cc66;">=</span> <span style="color: #ff4500;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e9 <span style="color: #66cc66;">=</span> edge_inc<span style="color: #66cc66;">;</span> edge_inc +<span style="color: #66cc66;">=</span> <span style="color: #ff4500;">1</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_faces.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span> v1<span style="color: #66cc66;">,</span> v6<span style="color: #66cc66;">,</span> v5<span style="color: #66cc66;">,</span> e7<span style="color: #66cc66;">,</span> e5<span style="color: #66cc66;">,</span> e3<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_faces.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span> v6<span style="color: #66cc66;">,</span> v2<span style="color: #66cc66;">,</span> v4<span style="color: #66cc66;">,</span> e1<span style="color: #66cc66;">,</span> e8<span style="color: #66cc66;">,</span> e6<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_faces.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span> v5<span style="color: #66cc66;">,</span> v4<span style="color: #66cc66;">,</span> v3<span style="color: #66cc66;">,</span> e4<span style="color: #66cc66;">,</span> e2<span style="color: #66cc66;">,</span> e9<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new_faces.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span> v6<span style="color: #66cc66;">,</span> v4<span style="color: #66cc66;">,</span> v5<span style="color: #66cc66;">,</span> e9<span style="color: #66cc66;">,</span> e7<span style="color: #66cc66;">,</span> e8<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; faces<span style="color: #66cc66;">=</span>new_faces<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> verts<span style="color: #66cc66;">,</span> faces</div></div>
<p>I hope the explanation was clear.<br />
It&#8217;s always fun to reinvent the wheel <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Dalai</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalaifelinto.com/?feed=rss2&#038;p=314</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spherical Panorama at Last</title>
		<link>http://www.dalaifelinto.com/?p=285</link>
		<comments>http://www.dalaifelinto.com/?p=285#comments</comments>
		<pubDate>Thu, 05 Apr 2012 23:31:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[blender]]></category>
		<category><![CDATA[domes]]></category>
		<category><![CDATA[game engine]]></category>
		<category><![CDATA[programação]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://www.dalaifelinto.com/?p=285</guid>
		<description><![CDATA[Can you spot the difference between those two images? Of course you can. But it took me 3 years to realize that the Spherical Panorama I coded in the Blender Game Engine was wrong. Holly Coding Christ. This is one of the BGE &#8220;dome&#8221; modes, but unlike the others, this one is used for debugging [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_301" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/martinsh_world.jpg"><img class="size-full wp-image-301" title="Martinsh Upitis work warped, planeted ;)" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/martinsh_world_550.jpg" alt="http://devlog-martinsh.blogspot.fr/2011/09/box-projected-cube-environment-mapping.html" width="550" height="550" /></a><p class="wp-caption-text">Teaser - click to see the fullsize - bge work from Martinsh Upitis</p></div>
<p><strong>Can you spot the difference between those two images?</strong></p>
<div id="attachment_286" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/0_0_0_wrong.png"><img class="aligncenter size-full wp-image-289" title="0_0_0_wrong" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/0_0_0_wrong.png" alt="" width="550" height="275" /></a><p class="wp-caption-text">Blender 2.49, 250, 2.51, 2.52</p></div>
<div id="attachment_287" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/0_0_0_right.png"><img class="size-full wp-image-287" title="Correct Spherical Panorama" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/0_0_0_right.png" alt="" width="550" height="275" /></a><p class="wp-caption-text">Blender 2.63 and beyond</p></div>
<p><span id="more-285"></span></p>
<p><strong>Of course you can.</strong> But it took me 3 years to realize that the Spherical Panorama I coded in the Blender Game Engine was wrong. Holly Coding Christ.</p>
<p>This is one of the BGE &#8220;dome&#8221; modes, but unlike the others, this one is used for debugging more than for deployment. Those past two days I&#8217;ve been investigating with <a href="http://w3.impa.br/~zang/">Aldo Zang</a> how to optimize the workflow for scene reconstruction from spherical panoramics (aka equirectangular images). The idea is to avoid the current workflow of setting up an <a title="HDR Labs" href="http://www.hdrlabs.com/sibl/archive.html">IBL image</a> as background, rendering a shot and using a calibration software to get the camera origin and coordinates. Given that we are talking about a very controlled scenario (where we know the FOV &#8211; field of view &#8211; of the camera, and can assume tons of other information) we believe we can improve the precision of the calibration process by addressing this particular scenario.</p>
<p>IBL in Cycles? Yup, if you use an HDR image in the background the light of the scene is almost solved. It takes only a few nodes:</p>
<div id="attachment_291" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/cycles_ibl.png"><img class="size-full wp-image-291" title="Cycles IBL as background" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/cycles_ibl_550.jpg" alt="" width="550" height="154" /></a><p class="wp-caption-text">Click to see the nodes</p></div>
<div id="attachment_293" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/ibl.jpg"><img class="size-full wp-image-293" title="IBL in Blender" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/ibl_550.jpg" alt="" width="550" height="309" /></a><p class="wp-caption-text">Click for the full size - HDR from HDRLabs</p></div>
<p>Our final goal is to use this with LuxRender (<a href="http://w3.impa.br/~zang/arlux/">ARLuxrender</a> actually), but all the reconstruction modelling will be done in Blender. Thus the need for a smooth workflow.<br />
So what Cycles has to do with the BGE? Not much. But I was using the BGE spherical panorama to test the calibration software. As it turned out the code was wrong from the source <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  that&#8217;s life I guess. Thanks Aldo for spotting that.</p>
<p>And why to have Spherical Panorama in the BGE again? Well if anything artists can do effects like this:</p>
<div id="attachment_299" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/martinsh_right.jpg"><img class="size-full wp-image-299" title="Martinsh Upitis BGE artwork" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/martinsh_right_550.jpg" alt="" width="550" height="275" /></a><p class="wp-caption-text">Spherical Panorama, ready to be transformed in the 1st image of this post - bge work by Martins Upitis</p></div>
<p>As a bonus you can see an image from the same scene, but warped with the old code:</p>
<div id="attachment_303" class="wp-caption aligncenter" style="width: 560px"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/04/martinsh_wrong.jpg"><img class="size-full wp-image-303 " title="martinsh_wrong_550" src="http://www.dalaifelinto.com/wp-content/uploads/2012/04/martinsh_wrong_550.jpg" alt="" width="550" height="275" /></a><p class="wp-caption-text">It may be subtle, but this one can&#39;t be planeted like the one before - bge work by Martins Upitis</p></div>
<p>Using the color coded images from the top of this post you can see why they are different. The ceiling and floor lines are way higher/lower in the fixed warping.</p>
<p>Now for the code savy out there, this was the change made (in a simplified version of the code). For the actual code <a href="https://svn.blender.org/svnroot/bf-blender/trunk/blender/source/gameengine/Ketsji/KX_Dome.cpp">go to the Blender svn</a> (look for FlattenPanorama).</p>
<p><em>Original Code:</em></p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">FlattenPanorama <span style="color: #008000;">&#40;</span>vert<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; φ <span style="color: #000080;">=</span> <span style="color: #0000dd;">atan2</span><span style="color: #008000;">&#40;</span>vert.<span style="color: #007788;">y</span>, vert.<span style="color: #007788;">x</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; x <span style="color: #000080;">=</span> φ <span style="color: #000040;">/</span> π<br />
&nbsp; &nbsp; y <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><br />
<br />
&nbsp; &nbsp; z <span style="color: #000080;">=</span> <span style="color: #0000dd;">atan2</span><span style="color: #008000;">&#40;</span>vert.<span style="color: #007788;">z</span>, <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; z <span style="color: #000040;">/</span><span style="color: #000080;">=</span> π <span style="color: #000040;">/</span> <span style="color: #0000dd;">2</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> x,y,z<br />
<span style="color: #008000;">&#125;</span></div></div>
<p><em>New Code:</em></p>
<div class="codecolorer-container cpp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="cpp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">FlattenPanorama <span style="color: #008000;">&#40;</span>vert<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; φ <span style="color: #000080;">=</span> <span style="color: #0000dd;">atan2</span><span style="color: #008000;">&#40;</span>vert.<span style="color: #007788;">y</span>, vert.<span style="color: #007788;">x</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; x <span style="color: #000080;">=</span> φ <span style="color: #000040;">/</span> π<br />
&nbsp; &nbsp; y <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><br />
<br />
&nbsp; &nbsp; θ <span style="color: #000080;">=</span> <span style="color: #0000dd;">asin</span><span style="color: #008000;">&#40;</span>vert.<span style="color: #007788;">z</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; z <span style="color: #000040;">/</span><span style="color: #000080;">=</span> θ <span style="color: #000040;">/</span> π<br />
<br />
&nbsp; &nbsp; <span style="color: #0000ff;">return</span> x,y,z<br />
<span style="color: #008000;">&#125;</span></div></div>
<p>Happy Easters,</p>
<p>Dalai</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalaifelinto.com/?feed=rss2&#038;p=285</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Massive Desktop with Multiple Projectors</title>
		<link>http://www.dalaifelinto.com/?p=274</link>
		<comments>http://www.dalaifelinto.com/?p=274#comments</comments>
		<pubDate>Wed, 14 Mar 2012 01:52:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[domes]]></category>
		<category><![CDATA[outros]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://www.dalaifelinto.com/?p=274</guid>
		<description><![CDATA[What do you do when you have 2 idle projectors by your computer? The answer is obviously a high definition projection area to be filled with lo.v.e. (lots of valuable experiments). Two short throw projectors in one seamless desktop I&#8217;ve been following the work of the Vision3D since 2009. This lab in Montreal is specialized [...]]]></description>
			<content:encoded><![CDATA[<p>What do you do when you have 2 idle projectors by your computer? The answer is obviously a high definition projection area to be filled with lo.v.e. (lots of valuable experiments).</p>
<p style="text-align: center;"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.01_full.jpg"><img class="aligncenter size-full wp-image-276" title="12.03.13.01" src="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.01.jpg" alt="" width="550" height="413" /></a></p>
<p style="text-align: center;">Two short throw projectors in one seamless desktop</p>
<p>I&#8217;ve been following the work of the Vision3D since 2009. This lab in Montreal is specialized in computer vision (recherche fondamentale et appliquée sur les aspects tridimensionnels de la vision par ordinateur). Lead by <a href="http://vision3d.iro.umontreal.ca/cat/personnes/sebastien-roy">Sébastien Roy</a> they have been producing (and sharing!) on calibration of projection surface (e.g. domes \o/), multiple projector systems, and content toolsets.</p>
<p style="text-align: center;"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.02_full.jpg"><img class="aligncenter size-full wp-image-277" title="12.03.13.02" src="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.02.jpg" alt="" width="550" height="413" /></a></p>
<p style="text-align: center;">lt-align manual calibration process</p>
<p>The Vision3D lab main tool in that area is <a title="Light Twist" href="http://vision3d.iro.umontreal.ca/projects/lighttwist/">Light Twist</a>. This tool was presented in the <a href="http://river-valley.tv/scaling-up-multiprojector-immersive-displays-the-lighttwist-project/">LGM2009</a> with a live showcase of the system in a cylinder. In the last week I tried to have light twist going with a multi projector system (aiming to use this for a dome later on) but so far I&#8217;m stuck in the playback of content (and I suspect the calibration stage is wrong). Anyways, light twist will be a topic of another post, once I get it up and running.</p>
<p style="text-align: center;"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.03_full.jpg"><img class="aligncenter size-full wp-image-278" title="12.03.13.03" src="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.03.jpg" alt="" width="550" height="413" /></a></p>
<p style="text-align: center;">Plugin enabled &#8211; video in the middle of the screens, desktop working normally</p>
<p>Since 2009 the light twist project shifted its focus from labs to end users. In 2011 they finally presented a new project called <a href="http://vision3d.iro.umontreal.ca/blog/2011/05/11/desktop-multi-projecteur-simple/">lt-align and lt-compiz-plugin</a>. The lt-align is a software to quickly calibrate the screens alignment, very easy to use.</p>
<p style="text-align: center;"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.04_full.jpg"><br />
</a></p>
<p>The Compiz plugin requires some fooling around with ubuntu settings, but once things are in place it works like a charm. I&#8217;m yet to make it work with Unity, so I can have real fullscreen across the desktops.</p>
<p style="text-align: center;"><iframe src="http://www.youtube.com/embed/3OhNvpo19us?rel=0" frameborder="0" width="550" height="309"></iframe></p>
<p style="text-align: center;">Recording of the alignment process and video playback</p>
<p><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.04_full.jpg"><img class="aligncenter" title="12.03.13.04" src="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.04.jpg" alt="" width="550" height="413" /></a></p>
<p style="text-align: center;">Elephants Dream &#8211; Stitched Edition <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><em>Note: there is an extra package you need to compile the lt-compiz-plugin:`<strong>sudo apt-get install compiz-plugins-main-dev</strong>. And I didn&#8217;t have to restart compiz with ccp to make it work. Also I changed the shortcuts to start the plugin because Alt+F* were taken by other OS commands.</em></p>
<p style="text-align: center;"><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.05_full.jpg"><img class="aligncenter size-full wp-image-280" title="12.03.13.05" src="http://www.dalaifelinto.com/wp-content/uploads/2012/03/12.03.13.05.jpg" alt="" width="550" height="413" /></a></p>
<p style="text-align: center;">Time to make it real and project in a large wall</p>
<p>In this picture you can see <strong>Djalma Lucio</strong>, sys admin that oversees all the computer installations at Visgraf on <a title="Instituto de Matemática Pura e Aplicada" href="http://www.impa.br/">IMPA</a>. A great professional and a very funny guy to work with. Think about someone that actually enjoys opening a xorg.conf file. And you can also see in the right <strong>Aldo Zang</strong>. Check it out his <a title="ARLuxRender" href="http://w3.impa.br/~zang/arlux/">ARLuxRender</a> project &#8211; a plugin system for LuxRender &#8220;which allows to render scenes with mixtures of real and virtual objects directly, without post-processing&#8221;.</p>
<p>I hope to post more in the coming months in domes, projections, a special video project &#8230; <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I went on a 3-month leave of my work at UBC to join the research lab at Visgraf/IMPA, under the coordination of prof. <a title="Luiz Velho" href="http://lvelho.impa.br/">Luiz Velho</a>. This is the second week only, but it&#8217;s been already a great experience. And above all, it&#8217;s nice to be back home (Rio de Janeiro, Brazil).</p>
<p>Happy Twisting,<br />
Dalai</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalaifelinto.com/?feed=rss2&#038;p=274</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thanks Microsoft for saving the day</title>
		<link>http://www.dalaifelinto.com/?p=261</link>
		<comments>http://www.dalaifelinto.com/?p=261#comments</comments>
		<pubDate>Sun, 04 Mar 2012 17:07:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.dalaifelinto.com/?p=261</guid>
		<description><![CDATA[What happens when an image fails to load in your system? It goes without saying that we need to find a non-intrusive way to analyze it. It happened to me today. An image downloaded from the internet was failing to load in my project (a virtual art gallery for domes, more on that once it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>What happens when an image fails to load in your system? It goes without saying that we need to find a non-intrusive way to analyze it.</p>
<p>It happened to me today. An image downloaded from the internet was failing to load in my project (a virtual art gallery for domes, more on that once it&#8217;s out). The internal framework involves to copy the image to the project folder and open it with <a href="http://www.blender.org/documentation/blender_python_api_2_62_1/bge.texture.html">Video Texture</a>. For those unfamiliar with the Blender Game Engine, this is a python module to dynamically load and swap in-game textures.</p>
<p>In my tests all the images I tried were working. No exception. But of course it takes only a test-run with the client to get a crash <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  One single image was enough to make me pull my hair.</p>
<p>Our beloved open image editor <a href="http://www.gimp.org">GIMP</a> opens the image with no problems. In fact if I open it and save it I can open it in my project with no problems. So what&#8217;s wrong? <strong>Why can&#8217;t GIMP warn me about this problematic file</strong>?</p>
<p>Looking for &#8216;file inspectors&#8217; I ran into this <a href="http://ie.microsoft.com/testdrive/HTML5/TypedArrays/">Binary File Inspector</a> from Microsoft. It didn&#8217;t take more than a glance to spot the problem:</p>
<p><a href="http://www.dalaifelinto.com/wp-content/uploads/2012/03/binary_cmyk.jpg"><img class="aligncenter size-full wp-image-263" title="binary_cmyk_550" src="http://www.dalaifelinto.com/wp-content/uploads/2012/03/binary_cmyk_550.jpg" alt="" width="550" height="223" /></a></p>
<p>CMYK &#8230; Bingo! Opening the image in a station with Photoshop proved this was the issue.</p>
<p>For the adventure seekers out there, remember: open source tools are great. Yet you should be not afraid of getting out of your comfort zone once in a while.</p>
<p>Who could guess that Microsoft would be the cavalry to make it up for the lack of CMYK (and feedback) support on GIMP <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  (or the lack of CMYK support in Video Texture, or me being short in tools for image forensics, &#8230;).</p>
<p>Have a great day,<br />
Dalai</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalaifelinto.com/?feed=rss2&#038;p=261</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Ted Talk &#8211; Daniel Pauly: The Ocean&#8217;s Shifting Baseline</title>
		<link>http://www.dalaifelinto.com/?p=247</link>
		<comments>http://www.dalaifelinto.com/?p=247#comments</comments>
		<pubDate>Wed, 29 Feb 2012 19:51:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[animação]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[science]]></category>

		<guid isPermaLink="false">http://www.dalaifelinto.com/?p=247</guid>
		<description><![CDATA[credits: Dalai Felinto, Mike Pan (Blender) and Sherman Lai (post processing)  It&#8217;s available on Ted Talk the presentation from Dr. Pauly on the ocean&#8217;s shifting baseline. The key idea is that we need to stick to a baseline in order to develop a more reliable feeling on the changes that are happening. But what happens [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter size-full wp-image-252" title="12.02.29_simulation" src="http://www.dalaifelinto.com/wp-content/uploads/2012/02/12.02.29_simulation.jpg" alt="" width="550" height="377" />credits: Dalai Felinto, Mike Pan (Blender) and Sherman Lai (post processing)</p>
<p> It&#8217;s available on Ted Talk the presentation from Dr. Pauly on the ocean&#8217;s shifting baseline. The key idea is that we need to stick to a baseline in order to develop a more reliable feeling on the changes that are happening.</p>
<p><!--// begin tedtalk//--><br />
<object width="550" height="391" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="bgColor" value="#ffffff" /><param name="flashvars" value="vu=http://video.ted.com/talk/stream/2010Z/Blank/DanielPauley_2010Z-320k.mp4&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/DanielPauley_2010Z-embed.jpg&amp;vw=512&amp;vh=288&amp;ap=0&amp;ti=1373&amp;lang=&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=daniel_pauly_the_ocean_s_shifting_baseline;year=2010;theme=ocean_stories;event=Mission+Blue+Voyage;tag=data;tag=oceans;tag=science;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" /><param name="src" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" /><param name="pluginspace" value="http://www.macromedia.com/go/getflashplayer" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><embed width="550" height="391" type="application/x-shockwave-flash" src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" allowFullScreen="true" allowScriptAccess="always" wmode="transparent" bgColor="#ffffff" flashvars="vu=http://video.ted.com/talk/stream/2010Z/Blank/DanielPauley_2010Z-320k.mp4&amp;su=http://images.ted.com/images/ted/tedindex/embed-posters/DanielPauley_2010Z-embed.jpg&amp;vw=512&amp;vh=288&amp;ap=0&amp;ti=1373&amp;lang=&amp;introDuration=15330&amp;adDuration=4000&amp;postAdDuration=830&amp;adKeys=talk=daniel_pauly_the_ocean_s_shifting_baseline;year=2010;theme=ocean_stories;event=Mission+Blue+Voyage;tag=data;tag=oceans;tag=science;&amp;preAdTag=tconf.ted/embed;tile=1;sz=512x288;" pluginspace="http://www.macromedia.com/go/getflashplayer" allowfullscreen="true" allowscriptaccess="always" /></object></p>
<p>But what happens when we can&#8217;t see the baseline? In this case the use of simulations &#8211; films and images &#8211; can be of great help. In the final slide of his presentation, Dr. Pauly showed an image to suggest a simulated ocean in 2010. <strong>You can see this at ~ 8:12.</strong></p>
<p><img class="aligncenter size-full wp-image-248" title="12.02.29_video_screenshot" src="http://www.dalaifelinto.com/wp-content/uploads/2012/02/12.02.29_video_screenshot.jpg" alt="" width="550" height="309" /></p>
<p>This is not one my favourite works, but it&#8217;s an important one. This image was made based on a still from the first animation made in Blender I worked on, back from early 2009: <a href="http://www.ecopath.org/LifeInTheChesapeakeBay/">The Life in The Chesapeake Bay</a>. It&#8217;s nice to look back and admire how many chances to improve my work I got.</p>
<p>To work with science communication is a thrill, and to have this work recognized really makes my day. Note that this image is not being used only to illustrate a particular ocean scenario. The image is there to make a point. To reenforce the role of art in the understanding of our lives.</p>
<p>. . .</p>
<p>And yes, it&#8217;s always great to spread Blender around the world, even when people are unaware of it (I was going to do a screenshot from the Blender file but I can&#8217;t find it &#8211; it took TedTalk way too long to make the stream online available <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p>A belated thank you for Villy Christensen, Sherman Lai and Mike Pan for the opportunity of doing the  <a href="http://www.ecopath.org/LifeInTheChesapeakeBay/">original project</a> together. And for York University and the unexpected strike in late 2008 <img src='http://www.dalaifelinto.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  God and his crooked lines, go figure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dalaifelinto.com/?feed=rss2&#038;p=247</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- start google analytics -->
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-28578911-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

<!-- end google analytics -->
</script>

