<?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>Stuart Denman</title>
	<atom:link href="http://www.stuartdenman.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stuartdenman.com</link>
	<description>Art and play is the mother of invention.</description>
	<lastBuildDate>Sat, 19 Jan 2013 04:59:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Raspberry Pi &#8211; A $25 Computer?</title>
		<link>http://www.stuartdenman.com/raspberry-pi-a-25-computer/</link>
		<comments>http://www.stuartdenman.com/raspberry-pi-a-25-computer/#comments</comments>
		<pubDate>Sat, 19 Jan 2013 04:32:51 +0000</pubDate>
		<dc:creator>stu</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[raspberry pi]]></category>

		<guid isPermaLink="false">http://www.stuartdenman.com/?p=343</guid>
		<description><![CDATA[Last year, it was about as easy to get a Raspberry Pi as it was to find an ATM in the Australian Outback. After being sold out for months, you can now get one of these little ARM-based computers for $35. Soon you&#8217;ll be able to buy a $25 model, but it has half the [...]]]></description>
			<content:encoded><![CDATA[<p>Last year, it was about as easy to get a Raspberry Pi as it was to find an ATM in the Australian Outback. After being sold out for months, you can now get one of these little ARM-based computers for $35. Soon you&#8217;ll be able to buy a $25 model, but it has half the memory and only one USB port. I prefer mine a double.</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2013/01/photo-2.jpg"><img class="aligncenter size-medium wp-image-345" title="Double Pi" src="http://www.stuartdenman.com/wp-content/uploads/2013/01/photo-2-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>It arrived last week from ModMyPi.com and I paid around $40 for the &#8220;bare bones&#8221; board. Prices are still a bit higher because of the demand. But before you can see anything on a screen from your RPi, you&#8217;ll end up forking over a lot more dough, because you&#8217;ll also need to pick up the following &#8220;necessary accessories&#8221;:</p>
<ul>
<li><strong>Storage:</strong> Any decent 4GB SD card will work, but why not grab a 32GB class 10 SDHC card like I did? $20 at newegg.com  The SD-card holds your operating system (Linux) files and any other tiny files you might normally keep on a tiny computer. But if you want more storage you can always plug in a USB thumb drive or an external hard drive.</li>
<li><strong>Power Supply: </strong>Your puny cell phone charger won&#8217;t deliver enough power for this monster of a tiny computer. You need at least 0.7A, but I got myself another iPad charger for around $13 (newegg.com), which delivers up to 2A. You&#8217;ll need the extra power when you start plugging in USB accessories, like <a href="http://www.youtube.com/watch?v=-eh3MEctwmQ">dancing USB monkeys</a>.</li>
<li><strong>Power Cable: </strong>Oops, your cell phone&#8217;s mini-USB cable won&#8217;t work either, you need a micro-USB cable. Did you catch that difference? $4 from ModMyPi.com  Because you can never have enough types of cables in your house.</li>
<li><strong>HDMI cable:</strong> 6&#8243; cable is $3.50 at monoprice.com, and comes in a variety of fantastic colors. I picked orange because it reminds me of my cat, Arthur, who I had before I left home for college. He ran into traffic because he missed me so much that he couldn&#8217;t go on without me. I expect your cable color to be equally sentimental&#8230;and tragic.</li>
<li><strong>WiFi Adapter:</strong> Sure, you could hook it to a dusty old ethernet cable, but who wants to be told where you have to put your Pi?  Edimax EW‑7811Un costs about $10 at newegg.com</li>
<li><strong>Case:</strong> ModMyPi sells a great little <a href="https://www.modmypi.com/raspberry-pi-cases">plastic case</a> for around $10, and you can even mix colors together. It&#8217;s durable and solid case, with slots and panels that can be removed if you want to insert gadgety-things into your Pi. I ended up also ordering a Ninja PiBow, which I haven&#8217;t yet put together. That one will cost you about $20, but the added coolness-factor is sure to end up being worth more than the $10 in additional cost. I&#8217;m kind of regretting not going rainbow on the PiBow, though. I didn&#8217;t want anyone to think I was fruity or something, but I&#8217;m kind of secretly rainbow-philic.</li>
<li><strong>Mouse/Keyboard:</strong> If you&#8217;re like me, you probably have lots of these lying around. Unfortunately, they were lying around in places where they we being used with other computers, so I had to order a new one for the Pi. $10 gets you a working keyboard from monoprice.com, or just go down to your local Goodwill and get one with greezy fingerprints for $1.</li>
</ul>
<p>OK, that&#8217;s the basics. So let&#8217;s see&#8230; carry the one&#8230; about $120 &#8211; $150, depending on how cool your &#8220;mods&#8221; are (or factor in shipping). That&#8217;s kind of a long way from $35, but still pretty cheap for a computer that can play 1080p movies and Quake III.</p>
<p>Still, don&#8217;t expect to be able to &#8220;work&#8221; on it in the same way you would on your Windows or Mac machine. The Graphical User Interface is rather slow. Browsing your favorite web sites will require some patience. But that&#8217;s not what I&#8217;m using it for. I want a low-power system that can sit on the network and talk to my home automation devices (light switches, garage door, etc.) I also hope to have it act as an AirPlay device and run an XBMC media server for my home theater. &#8220;How can a slow computer play movies,&#8221; you ask? Well, the same way it can run 3D games: its GPU can decompress movies and render 3D graphics, even though the CPU is not powerful enough to browse a web site. <img src='http://www.stuartdenman.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>If I end up just using it as a computer on the network (using an ethernet cable), then the core cost is only about $60-$70. If you downgrade to a 4GB SD-card and use old legos for a case (or no case), then you could probably get it down to around $55. Not bad. Even if you just used AirPlay, that&#8217;s a lot less than Apple&#8217;s $99 Airport Express.</p>
<p>Hopefully I&#8217;ll have time to post more about my future experience with this teeny-tiny computer.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartdenman.com%2Fraspberry-pi-a-25-computer%2F&amp;title=Raspberry%20Pi%20%E2%80%93%20A%20%2425%20Computer%3F" id="wpa2a_2"><img src="http://www.stuartdenman.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartdenman.com/raspberry-pi-a-25-computer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stylus Hunt</title>
		<link>http://www.stuartdenman.com/stylus-hunt/</link>
		<comments>http://www.stuartdenman.com/stylus-hunt/#comments</comments>
		<pubDate>Tue, 06 Nov 2012 06:58:08 +0000</pubDate>
		<dc:creator>stu</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Artwork]]></category>
		<category><![CDATA[sketching]]></category>
		<category><![CDATA[stylus]]></category>

		<guid isPermaLink="false">http://www.stuartdenman.com/?p=320</guid>
		<description><![CDATA[I&#8217;ve been looking into buying a stylus for drawing, because I have huge hands and fingers, like my father. Most of the styluses I&#8217;ve seen have a fat rubber or other squishy tip, which doesn&#8217;t seem much better than a finger. Apparently the iPad requires a minimum area of contact for the touch sensor to [...]]]></description>
			<content:encoded><![CDATA[<h2><a href="http://www.stuartdenman.com/wp-content/uploads/2012/06/wirelessground-ipad-stylus-4.jpg"><img class="alignright size-thumbnail wp-image-318" title="wirelessground-ipad-stylus-4" src="http://www.stuartdenman.com/wp-content/uploads/2012/06/wirelessground-ipad-stylus-4-150x150.jpg" alt="" width="150" height="150" /></a></h2>
<p>I&#8217;ve been looking into buying a stylus for drawing, because I have huge hands and fingers, like my father. Most of the styluses I&#8217;ve seen have a fat rubber or other squishy tip, which doesn&#8217;t seem much better than a finger. Apparently the iPad requires a minimum area of contact for the touch sensor to work (see photo on right).</p>
<p>Then I stumbled upon a Kickstarter project called the <a href="http://adonit.net/store/jot/">Jot by Adonit</a>, that has a ball tip and flat, clear disk so that you can see what you&#8217;re drawing. You can get one on Amazon now for a about $25, which isn&#8217;t too bad. Some reviewers are complaining that it scratches the glass, which worried me, and the Adonit website recommends a screen protector. But oh man, Kickstarter is packed with cool styluses in development. There&#8217;s the <a href="http://cregle.com/">iPen by Cregle</a>, which claims to have vastly improved precision and proximity tracking, but requires a plug-in device. The apps that support it seems to be minimal also. $89 is on the steep side. What I really want is pressure sensitivity like the Wacom tablets. Well, there&#8217;s a Kickstarter for that too.</p>
<p>The <a href="http://www.hex3.co/products/jaja">Jaja Stylus</a>, also $89, sends its pressure-sensitivity information via audio signals using a tiny speaker inside the pen. The maker, Hex3, claims the device battery lasts much longer than similar Bluetooth pens. It works pretty well, but the one I tried was on preview hardware and it had some bugs connecting to Procreate and Sketchbook Pro, so I wish I had more hands-on experience to pass along to you. I prefer the feel of rubber-tipped styluses to the hard plastic tip, however.</p>
<p>A few weeks ago I received my <a href="http://handstylus.com" target="_blank">Hand Stylus</a>, in green ($30). A little more affordable than some of the other fancy styluses. It&#8217;s got a nice weight to it, and the rubber nib is only 4mm. Because the tip has some friction with the glass, it&#8217;s about as close to how a pen feels on paper as you can get. The tips are replaceable (6 for $10) because they unfortunately don&#8217;t seem to last very long. The squishy tip is retractable and it rotates a bit with each click, in order to keep the wear even over the tip. Maybe I&#8217;m just not rotating it enough, because the rubber tip start to split after only a few hours of use.</p>
<p>Here&#8217;s a simple drawing that I did with the Hand Stylus using <a href="http://www.savagemedia.com.au/" target="_blank">Procreate</a>, based on a field I saw while driving in Eastern Washington:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/11/Autumn-Field-2012-11-05-10.45.05-671-PM-e1352184820620.jpg"><img class="size-full wp-image-337 aligncenter" title="Autumn Field" src="http://www.stuartdenman.com/wp-content/uploads/2012/11/Autumn-Field-2012-11-05-10.45.05-671-PM-e1352184820620.jpg" alt="" width="469" height="640" /></a></p>
<p>&nbsp;</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartdenman.com%2Fstylus-hunt%2F&amp;title=Stylus%20Hunt" id="wpa2a_4"><img src="http://www.stuartdenman.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartdenman.com/stylus-hunt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blender Physics Shape Exporter</title>
		<link>http://www.stuartdenman.com/blender-physics-shape-exporter/</link>
		<comments>http://www.stuartdenman.com/blender-physics-shape-exporter/#comments</comments>
		<pubDate>Wed, 11 Jul 2012 23:26:58 +0000</pubDate>
		<dc:creator>stu</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[bullet physics]]></category>
		<category><![CDATA[exporters]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[YAML]]></category>

		<guid isPermaLink="false">http://www.stuartdenman.com/?p=323</guid>
		<description><![CDATA[Here&#8217;s a little Blender script I wrote to export Bullet-compatible compound physics collision shapes to a YAML text file. I&#8217;ve released it as open-source on Google Code: Export Physics Shapes Addon For Blender YAML is a great file format I&#8217;ve been using a lot lately. YAML parsers support JSON and the format is more compact and [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_324" class="wp-caption alignright" style="width: 250px"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/07/Screen-shot-2012-07-11-at-4.13.27-PM.png"><img class="size-full wp-image-324" title="Mushroom physics shapes" src="http://www.stuartdenman.com/wp-content/uploads/2012/07/Screen-shot-2012-07-11-at-4.13.27-PM.png" alt="" width="240" height="291" /></a><p class="wp-caption-text">Example of a mushroom with two cylinders in a compound physics shape.</p></div>
<p>Here&#8217;s a little <a href="http://blender.org" target="_blank">Blender</a> script I wrote to export <a href="http://bulletphysics.org/" target="_blank">Bullet</a>-compatible compound physics collision shapes to a <a href="http://www.yaml.org" target="_blank">YAML</a> text file. I&#8217;ve released it as open-source on Google Code:</p>
<p style="padding-left: 30px;"><a href="http://code.google.com/p/blender-scripts/wiki/ExportPhysicsShapes" target="_blank">Export Physics Shapes Addon For Blender</a></p>
<p>YAML is a great file format I&#8217;ve been using a lot lately. YAML parsers support JSON and the format is more compact and more readable than XML, but adds some great features like type-tags and a simple comment format. I highly recommend it.</p>
<h3>Application Usage</h3>
<p>If you are using Bullet Physics, your application must create a parent <span style="font-family: 'courier new', courier;"><a href="http://bulletphysics.com/Bullet/BulletFull/classbtCompoundShape.html" target="_blank">btCompoundShape</a></span> and then parse the exported YAML file to create the child shapes. The exporter supports the following shapes: <strong>Box</strong>,<strong> Sphere</strong>,<strong> Cylinder</strong>,<strong> Cone</strong>,<strong> Capsule</strong>, and<strong> ConvexHull</strong></p>
<p>Note that even though the exported shapes are siblings of one another, by default the <span style="font-family: 'courier new', courier;">btCompoundShape</span> class will create an automatic AABB tree so that it won&#8217;t be testing against every shape on collision with your object.</p>
<p>Your application should construct a <span style="font-family: 'courier new', courier;"><tt>btTransform</tt></span> from the properties <em>origin</em>, <em>scale</em> and <em>rotate</em>. The <em>rotate</em> property provides a quaternion sequence in WXYZ order and is compatible with <tt>btTransform::setRotation()</tt>.</p>
<p><a href="http://code.google.com/p/yaml-cpp/wiki/Tutorial" target="_blank">yaml-cpp</a> (new API) is recommended for parsing YAML files in C++.</p>
<h3>Blender Installation</h3>
<p>This script has only been tested with Blender 2.63, but it may work with earlier versions as well. In Blender User Preferences &gt; Addons tab, click the [Install Addon...] button and select the <em>export_physics.py</em> script file. Alternatively, copy the <em>export_physics.py</em> script file to your blender addons folder and enable it in User Preferences &gt; Addons. See blender <a href="http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/Add-Ons">documentation</a> for more information.</p>
<h3>Blender Usage</h3>
<p>To create a compound physics shape for a mesh in blender:</p>
<ol>
<li>Place the 3D cursor at the origin of the mesh object.</li>
<li>Add &gt; Empty, name it &#8220;physics&#8221;</li>
<li>Create a physics shape with Add &gt; Mesh &gt; Cube, UV Sphere, Cylinder, Cone or create an arbitrary mesh for a ConvexHull shape.</li>
<li>Parent the new shape to the &#8220;physics&#8221; Empty.</li>
<li>The mesh name must start with: Box, Sphere, Cylinder, Cone, Capsule, or ConvexHull, depending on the shape you want.</li>
<li>Position and scale the shape object, but do not modify the internal vertices, unless it is a ConvexHull type.</li>
<li>Repeat steps 3-6 until your compound shape is complete. Shapes can only be a 1-level deep hierarchy.</li>
<li><strong>Important: </strong>Select the parent empty object named &#8220;physics&#8221;</li>
<li>Click File &gt; Export &gt; Physics Shapes (.yaml)</li>
</ol>
<h3>Exporter Options</h3>
<ul>
<li><strong>Append To Existing File</strong> &#8211;&gt; Appends the Physics shapes to an existing YAML file</li>
<li><strong>Convert To Y-Up</strong> &#8211;&gt; Converts the values to a Y-Axis Up coordinate system</li>
<li><strong>Root Name</strong> &#8211;&gt; The top-level name (in the YAML file) that will contain the physics shapes</li>
</ul>
<h3>Example YAML output</h3>
<p>This physics shape output was appended from 2 separate meshes: tree and stalagmite</p>
<pre>tree:
  physics:
  - shape: Cylinder
    origin: [-0.0272567,0.630798,0.0155753]
    half-extents: [0.123097,0.64184,0.123097]
  - shape: Sphere
    origin: [0.0406867,1.64268,-0.0203434]
    radius: 0.4183913767337799
stalagmite:
  physics:
  - shape: Cone
    origin: [0.0335,1.0,0]
    radius: 0.35
    height: 1.0</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartdenman.com%2Fblender-physics-shape-exporter%2F&amp;title=Blender%20Physics%20Shape%20Exporter" id="wpa2a_6"><img src="http://www.stuartdenman.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartdenman.com/blender-physics-shape-exporter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sketching Around</title>
		<link>http://www.stuartdenman.com/sketching-around-1/</link>
		<comments>http://www.stuartdenman.com/sketching-around-1/#comments</comments>
		<pubDate>Sat, 09 Jun 2012 22:45:38 +0000</pubDate>
		<dc:creator>stu</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Artwork]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[Paper Mouse]]></category>
		<category><![CDATA[sketchbook pro]]></category>
		<category><![CDATA[sketching]]></category>

		<guid isPermaLink="false">http://www.stuartdenman.com/?p=316</guid>
		<description><![CDATA[Here&#8217;s one I did a few weeks ago on the iPad using Autodesk SketchBook Pro. I was trying to visualize how my mouse character would look if he were to roll into a ball. The app supports a lot of layers, which I can use to sketch different shapes and experiment with facial expressions to [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s one I did a few weeks ago on the iPad using Autodesk SketchBook Pro. I was trying to visualize how my mouse character would look if he were to roll into a ball.</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/06/Sketch-2012-05-31-08_51_53.png"><img class="alignnone size-medium wp-image-317" title="Mouse Roll Sketch" src="http://www.stuartdenman.com/wp-content/uploads/2012/06/Sketch-2012-05-31-08_51_53-266x300.png" alt="" width="266" height="300" /></a></p>
<p>The app supports a lot of layers, which I can use to sketch different shapes and experiment with facial expressions to get the look I want, similar to Photoshop. I enjoy sketching on the iPad because it just feels a bit more loose when you&#8217;re drawing with your finger in a big comfortable chair, as opposed to sitting all stiff in front of a computer. I tend toward more technical drawing patterns, so I&#8217;m trying to practice sketching with more fluidity.</p>
<p>I don&#8217;t think the ears are quite right yet&#8230;what do you think?</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartdenman.com%2Fsketching-around-1%2F&amp;title=Sketching%20Around" id="wpa2a_8"><img src="http://www.stuartdenman.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartdenman.com/sketching-around-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mouse Character Model &#8211; Part 3</title>
		<link>http://www.stuartdenman.com/mouse-character-model-part-3/</link>
		<comments>http://www.stuartdenman.com/mouse-character-model-part-3/#comments</comments>
		<pubDate>Thu, 07 Jun 2012 01:31:05 +0000</pubDate>
		<dc:creator>stu</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Artwork]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[modeling]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[Paper Mouse]]></category>
		<category><![CDATA[textures]]></category>
		<category><![CDATA[uv mapping]]></category>

		<guid isPermaLink="false">http://www.stuartdenman.com/?p=303</guid>
		<description><![CDATA[Previously, I showed the progress leading up to creating a mouse model in Blender: Mouse Character Model &#8211; Part 1 Mouse Character Model &#8211; Part 2 More Mesh Tweaks I&#8217;ve been coding a lot lately, but recently I got to the point where I needed to finish this mouse character. In the last day or [...]]]></description>
			<content:encoded><![CDATA[<p>Previously, I showed the progress leading up to creating a mouse model in Blender:</p>
<p><a title="Work-In-Progress Character Model" href="http://www.stuartdenman.com/work-in-progress-character-model/">Mouse Character Model &#8211; Part 1<br />
</a><a title="Mouse Character Model – Part 2" href="http://www.stuartdenman.com/mouse-character-model-part-2/">Mouse Character Model &#8211; Part 2</a></p>
<h2>More Mesh Tweaks</h2>
<p>I&#8217;ve been coding a lot lately, but recently I got to the point where I needed to finish this mouse character. In the last day or so, I&#8217;ve made quite a few smallish changes to the mesh, and here&#8217;s my latest version:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-5.47.58-PM.png"><img class="aligncenter size-full wp-image-304" title="Mouse Model - June 2012" src="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-5.47.58-PM.png" alt="" width="395" height="295" /></a></p>
<p>Changes of note are:</p>
<ul>
<li>I shaped and added resolution to the feet, including some toes.</li>
<li>Added more definition in the back legs so that they bulge-out some.</li>
<li>Removed quite a bit of body length, mostly between the front and back legs.</li>
<li>Created some additional mesh details in preparation for skeletal rigging.</li>
<li>Pulled in the under-side of the jaw a bit.</li>
<li>Using smooth shading with a simple Lambert color-ramp material to show the contours better.</li>
</ul>
<p>What do you guys think?  Thanks for the feedback!</p>
<h2>Unwrapping For Fun and Profit</h2>
<p>With the mesh pretty much the way I want it, I turned my efforts toward texture-mapping. If you&#8217;re a Blender beginner, please Google a Blender texture mapping tutorial before you read further, or you might find yourself a bit lost.</p>
<p>The first step is to &#8220;<em>unwrap&#8221;</em> the mesh to generate the UV coordinates at each vertex. To do this, I marked &#8220;seam&#8221; edges on the mesh. Because we&#8217;re using a mirror modifier, there&#8217;s already a seam along the central axis of the body (top and bottom). So all I need to do is mark seams on <span style="text-decoration: underline;">one</span> side of the body to separate the tail, legs, feet, and ears. The seams are indicated below with red edges:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-6.02.27-PM.png"><img class="aligncenter size-full wp-image-305" title="Mouse Model - June 2012 - UV Seams" src="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-6.02.27-PM.png" alt="" width="355" height="319" /></a></p>
<p>While in Edit Mode, I just selected the edges I wanted to be seams and then clicked the [Mark Seam] button in the mesh tools panel. Make sure the parts are completely separated from the body &#8211; the seams should go all the way around the circumference of the legs. Next, click the &#8220;UV Mapping: [Unwrap] button&#8221; in the tools panel. Select all vertices and then go to the UV Editor. You should see a layout similar to this:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-6.14.58-PM.png"><img class="aligncenter size-full wp-image-306" title="Mouse Model - June 2012 - UV Unwrap" src="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-6.14.58-PM.png" alt="" width="328" height="328" /></a></p>
<p>This is pretty good, but I want to add some fur with a &#8220;directional grain&#8221; to it, and that means the UV mapping will partially determine what direction the hair flows. The other issue will be that I need to make sure that the fur grain approximately matches up at the seams, especially where the legs and tail meet the body. I created a simple high-contrast grayscale fur texture using a Photoshop filters. I&#8217;ll just use this to make sure things are roughly correct:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/06/fur_hair.png"><img class="aligncenter size-full wp-image-307" title="fur_hair texture" src="http://www.stuartdenman.com/wp-content/uploads/2012/06/fur_hair.png" alt="" width="256" height="256" /></a></p>
<p>The technique I used is just to select the various &#8220;UV islands&#8221; by clicking on a vertex and then select linked (Ctrl+L). Rotate and scale the UV islands while looking at the mesh to check for alignment. I also left some space in the upper-right corner, which I will later use for mapping the eyes and nose into this same texture. After about an hour, here are my results:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-6.24.39-PM.png"><img class="aligncenter size-full wp-image-308" title="Mouse Model - June 2012 - UV Final" src="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-6.24.39-PM.png" alt="" width="418" height="418" /></a></p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-6.22.58-PM.png"><img class="aligncenter size-medium wp-image-309" title="Mouse Model - June 2012 - UV Mapping" src="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-6.22.58-PM-300x218.png" alt="" width="300" height="218" /></a></p>
<p>Notice that the grain of the fur on the legs matches with the body. On the ears, I chose to change the grain direction, but the final texture won&#8217;t be so high contrast, so I will try to cover up this discontinuity when I paint the diffuse texture in 3D. The diffuse texture will be blended with the fur detail and a baked ambient occlusion map to create the final texture.</p>
<h2 style="text-align: left;">Color Grid Texture</h2>
<p style="text-align: left;">Blender has a couple of &#8220;generated&#8221; textures that help you visualize the UV mapping. One that I particularly like is the &#8220;Color Grid&#8221; type. Just create a texture of &#8220;Image or Movie&#8221; type and then select &#8220;Source: Generated, Color Grid.&#8221;  This type of texture lets you verify that the texels (<strong>tex</strong>ture pix<strong>el</strong>s) are consistent in size over the entire mesh.</p>
<p style="text-align: left;">Here is an example, using the same UV mapping above with a colored test grid texture:</p>
<p style="text-align: center;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-10.20.49-PM.png"><img class="wp-image-312 alignnone" title="Mouse Model - June 2012 - UV Grid" src="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-10.20.49-PM.png" alt="" width="300" height="300" /></a> <a href="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-10.20.30-PM.png"><img class="wp-image-313 alignnone" title="Mouse Model - June 2012 - UV Grid 3D" src="http://www.stuartdenman.com/wp-content/uploads/2012/06/Screen-shot-2012-06-06-at-10.20.30-PM.png" alt="" width="300" height="300" /></a></p>
<p style="text-align: left;">The next step will be to set up a material node shader in Blender and then use the 3D painting tool to create the fur texture. Stay tuned for Part 4!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartdenman.com%2Fmouse-character-model-part-3%2F&amp;title=Mouse%20Character%20Model%20%E2%80%93%20Part%203" id="wpa2a_10"><img src="http://www.stuartdenman.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartdenman.com/mouse-character-model-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mouse Character Model &#8211; Part 2</title>
		<link>http://www.stuartdenman.com/mouse-character-model-part-2/</link>
		<comments>http://www.stuartdenman.com/mouse-character-model-part-2/#comments</comments>
		<pubDate>Tue, 15 May 2012 17:50:56 +0000</pubDate>
		<dc:creator>stu</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Artwork]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[3D graphics]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[modeling]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[Paper Mouse]]></category>

		<guid isPermaLink="false">http://www.stuartdenman.com/?p=285</guid>
		<description><![CDATA[Last week I posted a intermediate-level tutorial on how to model a mouse from sketches in Blender. This week I continue with how to add eyes and a tail. For a refresher, here&#8217;s where I left off last time, after completing the ears: Making The Eyes Edit the body mesh (TAB) and cut a starting hole [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I posted a intermediate-level <a title="Work-In-Progress Character Model" href="http://www.stuartdenman.com/work-in-progress-character-model/">tutorial</a> on how to model a mouse from sketches in <a href="http://blender.org">Blender</a>. This week I continue with how to add eyes and a tail. For a refresher, here&#8217;s where I left off last time, after completing the ears:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-2.04.47-PM.png"><img class="aligncenter size-full wp-image-276" title="Mouse Ears Step 5" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-2.04.47-PM.png" alt="" width="248" height="274" /></a></p>
<h2>Making The Eyes</h2>
<p>Edit the body mesh (TAB) and cut a starting hole for the eyes by selecting a polygon near the eye and deleting it (X-Key):</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.13.09-AM.png"><img class="aligncenter size-full wp-image-286" title="Mouse Mesh Eye Step 1" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.13.09-AM.png" alt="" width="318" height="307" /></a></p>
<p>In my concept sketches, the eye is an oval shape, but to animate the eyes properly, they need to be spherical. We can achieve the oval shape by positioning a large eye ball mostly inside the body and shape the eye socket to create the oval (look at your own eyes in the mirror).</p>
<p>To create an eye ball, switch back to Object Mode (TAB) and in the Add menu, select Mesh -&gt; UV Sphere. Scale and position the eye so that it is roughly where you want it. It might help to add a pupil texture to help with positioning it. I won&#8217;t cover texturing in this tutorial, but there are a lot of <a href="http://cg.tutsplus.com/articles/web-roundups/tutorial-roundup-53-amazing-blender-tutorials/">resources on the web</a>.</p>
<p style="text-align: center;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.29.35-AM.png"><img class="size-full wp-image-288 alignnone" title="Screen shot 2012-05-15 at 9.29.35 AM" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.29.35-AM.png" alt="" width="200" height="200" /></a>   <a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.29.55-AM.png"><img class="size-full wp-image-287 alignnone" title="Mouse Mesh Eye Step 2b" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.29.55-AM.png" alt="" width="200" height="200" /></a></p>
<p style="text-align: left;">Then I said &#8220;Oops!&#8221; and replaced the eye with a lower-polygon-count UV sphere. <img src='http://www.stuartdenman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   Eye meshes are easy to create, so you can always change the triangle count later. Create a linked duplicate for the left eye so that the left eye shares the mesh with the right eye. Position it mirrored (copy the X coordinate and make it negative). Now we can begin creating the socket shape around the eye ball.</p>
<p style="text-align: left;">Begin by shaping the edge around the polygon that you cut out. Subdivide the edges using the Knife Tool (K-key) and drag the edge vertices out from the eye until you have a socket that is quite a bit larger than the eye ball. Here I&#8217;ve selected all the edges that I either subdivided or added:</p>
<p style="text-align: left;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.43.18-AM.png"><img class="aligncenter size-full wp-image-289" title="Mouse Mesh Eye Step 3" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.43.18-AM.png" alt="" width="256" height="279" /></a></p>
<p>Next, select the inner edge loop around the socket and extrude with scale (E, S). Extrude twice to create nice quad loops around the eye ball:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.48.06-AM.png"><img class="aligncenter size-full wp-image-290" title="Mouse Mesh Eye Step 4" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.48.06-AM.png" alt="" width="200" height="200" /></a></p>
<p>Then one more extrude with scale. This time you also want to pull the loop down into the eye ball to create the edge of an eye lid. I&#8217;m also going to add a white material to the eye ball so that it stands out better:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.54.43-AM.png"><img class="aligncenter size-full wp-image-291" title="Mouse Mesh Eye Step 5" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-9.54.43-AM.png" alt="" width="200" height="200" /></a></p>
<p>These loops around the eye will be important if an animator needs to manipulate the eye lids to give the mouse more emotional character. At this point there are several problems. My mouse is looking a bit sleepy here, so I need to flatten out the loops around the eye. The resolution looks a bit low as well, so I added some more cuts. I did about two hours worth of knife cutting and shaping to get it all looking perfect (give me a break, this is my first time modeling eyes). <em>Et voila!</em></p>
<p style="text-align: center;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-10.00.20-AM.png"><img class="size-full wp-image-292 alignnone" title="Screen shot 2012-05-15 at 10.00.20 AM" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-10.00.20-AM.png" alt="" width="300" height="300" /></a>    <a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-10.04.41-AM.png"><img class="size-full wp-image-293 alignnone" title="Mouse Mesh Eye Final B" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-15-at-10.04.41-AM.png" alt="" width="300" height="300" /></a></p>
<p style="text-align: left;">From the side, the eye is looking oval-shaped as I wanted in my sketch. Great!  I also did some work to scale in the body, as my mouse was looking a bit wide. All ready to add the tail&#8230;</p>
<h2 style="text-align: left;">A Tale of A Tail</h2>
<p>The tail was actually quite easy to model compared to the eyes, the hard part was figuring out how many segments it should have to look smooth when the bones are bending. Too few segments and it will look jagged. I made a separate tail model and experimented with a few different bone counts. I ended up with a 16-segment tail, but your count may vary depending on length and target screen. The iPad is pretty detailed, so I don&#8217;t want to cheat on polygons.</p>
<p>Start by shaping the &#8220;tail hole&#8221; so that it&#8217;s round and the right number of edges around. I chose 10 (decagon). If you change your mind on this later, you&#8217;ll probably have to redo the tail. No pressure.</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-14-at-5.41.38-PM.png"><img class="alignnone size-full wp-image-295" title="Mouse Mesh Tail Step 1a" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-14-at-5.41.38-PM.png" alt="" width="387" height="355" /></a>    <a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-14-at-5.41.53-PM.png"><img class="alignnone size-full wp-image-296" title="Mouse Mesh Tail Step 1b" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-14-at-5.41.53-PM.png" alt="" width="303" height="377" /></a></p>
<p>From here, you&#8217;ll be doing one short Extrude and Scale (E&amp;S) to start the tail, then a very long E&amp;S to establish the length. You may notice that when you scale, it pulls the vertices away from the center (X=0). This is because we&#8217;re using the Mirror Modifier, so the vertices we actually have selected are just the ones on the right half of the tail (see origin in the above images). Scaling around that center pulls the vertices away from the Y-Z plane. There are two ways to fix this:</p>
<ul>
<li><strong>Method 1: </strong>After scaling, select only the vertex that is closest to X=0. Copy its X coordinate. Then select the vertices in the loop you just scaled and translate them using this X coordinate: hit G (grab) and then Enter (confirm). Then in the tools panel you can paste the X translation amount and negate it to move all the vertices back towards the center of the tail.</li>
<li><strong>Method 2: </strong>Before scaling your extruded edge loop, perform a &#8220;Snap -&gt; Cursor to Selected.&#8221; This will place the 3D cursor in the center of the extruded half-loop. Next, move the 3D cursor on to the Y-Z plane by setting the 3D cursor X coordinate in the properties panel (N-Key) to zero. Select 3D cursor as the Pivot Point, then scale.</li>
</ul>
<p>Finish the tail with a couple more E&amp;S operations, ending in a vertex merge (Alt+M) to create a point:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-14-at-9.00.14-PM.png"><img class="aligncenter size-full wp-image-297" title="Mouse Mesh Tail Step 2" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-14-at-9.00.14-PM.png" alt="" width="425" height="316" /></a></p>
<p>It&#8217;s important at this point, before you subdivide the tail into segments, that you get the tail tapering and size just right. Normally to subdivide something like this I would just use the &#8220;Loop Cut and Slide&#8221; command, but Blender doesn&#8217;t like the fact that the tail isn&#8217;t a true loop (again, due to the Mirror Modifier). To subdivide, the best method I&#8217;ve found is to select all the long edges running parallel with the tail (do not select any loop edges). Then simply subdivide those edges.</p>
<p>In the Tool Properties -&gt; Subdivide, choose the number of cuts to create. In my case I wanted 12, but the interface only goes up to 10. I got around this by doing two subdivides first by 2 cuts and the second by 3 cuts. Here&#8217;s the result, all ready for rigging:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-14-at-9.03.11-PM.png"><img class="aligncenter size-full wp-image-298" title="Mouse Mesh Tail Step 3" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-14-at-9.03.11-PM.png" alt="" width="509" height="175" /></a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartdenman.com%2Fmouse-character-model-part-2%2F&amp;title=Mouse%20Character%20Model%20%E2%80%93%20Part%202" id="wpa2a_12"><img src="http://www.stuartdenman.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartdenman.com/mouse-character-model-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Work-In-Progress Character Model</title>
		<link>http://www.stuartdenman.com/work-in-progress-character-model/</link>
		<comments>http://www.stuartdenman.com/work-in-progress-character-model/#comments</comments>
		<pubDate>Fri, 11 May 2012 21:12:17 +0000</pubDate>
		<dc:creator>stu</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Artwork]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[3D graphics]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[modeling]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[Paper Mouse]]></category>
		<category><![CDATA[sketchbook pro]]></category>
		<category><![CDATA[sketching]]></category>

		<guid isPermaLink="false">http://www.stuartdenman.com/?p=264</guid>
		<description><![CDATA[I&#8217;ve been in &#8220;artist mode&#8221; the last couple of days. This post will be the first (very rough) sneak peek at the character for the &#8220;indie&#8221; 3D mobile game I&#8217;m developing. Concept Phase First I made some quick sketches on my iPad using Autodesk Sketchbook Pro: It&#8217;s challenging to sketch with my fat fingers, but [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been in &#8220;artist mode&#8221; the last couple of days. This post will be the first (very rough) sneak peek at the character for the &#8220;indie&#8221; 3D mobile game I&#8217;m developing.</p>
<h2>Concept Phase</h2>
<p>First I made some quick sketches on my iPad using Autodesk Sketchbook Pro:</p>
<p style="text-align: center;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Sketch-2012-05-11-00_38_38.png"><img class="aligncenter  wp-image-265" title="Sketch 2012-05-11 00_38_38" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Sketch-2012-05-11-00_38_38-1024x782.png" alt="" width="614" height="469" /></a></p>
<p style="text-align: left;">It&#8217;s challenging to sketch with my fat fingers, but if I zoom in a lot it works. I really enjoy sketching on it. I might buy a stylus at some point soon to improve the accuracy.</p>
<p style="text-align: left;">The layers in Sketchbook Pro make it very easy to rough sketch on a bottom-layer and then go in with ink and color later if you want. It&#8217;s good to try different shapes on multiple layers so you can compare them and select the best one. For example, from the side-view, I tried both the more &#8220;upright&#8221; and &#8220;forward&#8221; arching mouse shape (above), as well as a &#8220;semi-circle arc&#8221; shape &#8211; one that looked more like an actual mouse:</p>
<p style="text-align: left;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Mouse-Semicircle.jpg"><img class="aligncenter size-full wp-image-266" title="Mouse-Semicircle" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Mouse-Semicircle.jpg" alt="" width="463" height="309" /></a></p>
<p style="text-align: left;">The more realistic I made the head shape, eyes, and nose, the less friendly and more &#8220;critter-like&#8221; the character became. Since I&#8217;m targeting casual gamers for this title and the story works best when the player has empathy for the mouse, I choose a friendlier art direction.</p>
<h2 style="text-align: left;">From 2D Sketch To 3D Mesh</h2>
<p><img class="size-full wp-image-267 alignright" style="margin-left: 4px; margin-right: 4px;" title="Screen shot 2012-05-11 at 12.57.37 PM" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-12.57.37-PM.png" alt="" width="189" height="327" /></p>
<p style="text-align: left;">Once I decided on a general direction with the sketch, I imported the sketches into Blender using the Background Images section in the 3D view options (N-key). This feature does exactly what I needed. It only shows the sketches when you&#8217;re aligned to a particular view direction (in orthographic) and you can easily blend the foreground polygons with the sketch so you can see it as you are modeling. Once you add a sketch image, the panel has options for scaling and moving the sketch around, so it was relatively easy to align it exactly to the size and offset that I needed.</p>
<p style="text-align: left;">There&#8217;s a decent tutorial on modeling from images that you can read <a href="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Modeling_a_Fox_from_Guide_Images" target="_blank">here</a>. I ended up using the first technique of extruding boxes, but with a mirror modifier along the X axis.</p>
<p style="text-align: left;">Another good Blender character modeling tutorial can be found <a href="http://www.blendernation.com/2008/03/21/character-modelling-a-eh-mouse/" target="_blank">here</a>. This one showed me how to sculpt by extruding loop edges instead of faces (more on this below).</p>
<p style="text-align: left;">I began to extrude out a cube to approximately the right shape from the top and side views. Then I began loop cutting and shaping the body until it was round instead of rectangular.</p>
<p style="text-align: left;">I have coded some pretty compelling character physics tech (more in a later post). So I&#8217;m building this character to work with that tech. At this early phase of modeling, all I want is a rough shape so I can be sure the tech is going to work as expected. My first test of the tech was on a simple tail model, and it looked great, but the body is going to be a bit more challenging.</p>
<p style="text-align: left;">Here&#8217;s a &#8220;work-in-progress&#8221; capture of the mouse body (no tail, eyes, or whiskers yet). The feet and nose are just roughed-in for now. I think the front legs might be too far forward, what do you think?</p>
<p style="text-align: center;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-12.31.02-PM.png"><img class="aligncenter  wp-image-268" title="Mouse Mesh WIP" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-12.31.02-PM-1024x785.png" alt="" width="614" height="471" /></a></p>
<h2 style="text-align: left;">Building the Ears</h2>
<p style="text-align: left;">I used the &#8220;loop edge extrude&#8221; technique to build the ears. Start by extruding a row of faces from the top of the body to create an &#8220;wall&#8221; shape. The <a href="http://www.blender.org/development/release-logs/blender-230/blender-knife-tutorial/" target="_blank">Knife Tool</a> works well for sizing the faces before you extrude the ears. Then shape the top of the wall into a rough ear outline. You&#8217;ll need to subdivide those faces enough to create a somewhat smooth arc. Here&#8217;s what mine looked like at this point:</p>
<p style="text-align: left;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-1.42.43-PM.png"><img class="aligncenter size-full wp-image-272" title="Mouse Ears Step 1" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-1.42.43-PM.png" alt="" width="182" height="197" /></a></p>
<p style="text-align: left;">You&#8217;ll have a bunch of long quads formed when you extruded the ears out from the body, but you can just delete these (X-key). This leaves a hole, surrounded by a loop of quads that was once the &#8220;top&#8221; of your &#8220;ear wall.&#8221;</p>
<p style="text-align: left;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-1.46.18-PM.png"><img class="aligncenter size-full wp-image-273" title="Mouse Ears Step 2" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-1.46.18-PM.png" alt="" width="267" height="261" /></a></p>
<p style="text-align: left;">Now, in edge-select-mode, select the top edge of the loop (Alt-Right-Click) and then extrude the edges (E-key) and then hit S to scale them in. Repeat this a couple times.</p>
<p style="text-align: center;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-1.46.57-PM.png"><img class=" wp-image-274 alignnone" title="Mouse Ears Step 3" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-1.46.57-PM.png" alt="" width="263" height="274" /></a>        <a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-1.47.33-PM.png"><img class="size-full wp-image-275 alignnone" title="Mouse Ears Step 4" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-1.47.33-PM.png" alt="" width="259" height="274" /></a></p>
<p style="text-align: left;">To complete the ear center, extrude one last time and then hit Alt-M to merge the vertices to one center vertex. From this point you need to do the same for the back of the ear. Once you have the topology built, it&#8217;s time to sculpt. I used the Proportional editing tool with vertex grab (move). But the sculpting brushes will also work for this.</p>
<p style="text-align: left;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-2.04.47-PM.png"><img class="aligncenter size-full wp-image-276" title="Mouse Ears Step 5" src="http://www.stuartdenman.com/wp-content/uploads/2012/05/Screen-shot-2012-05-11-at-2.04.47-PM.png" alt="" width="248" height="274" /></a></p>
<p style="text-align: left;">Please leave a comment and let me know what you think!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartdenman.com%2Fwork-in-progress-character-model%2F&amp;title=Work-In-Progress%20Character%20Model" id="wpa2a_14"><img src="http://www.stuartdenman.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartdenman.com/work-in-progress-character-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++: Using template friend from a namespace</title>
		<link>http://www.stuartdenman.com/template-friend-from-namespace/</link>
		<comments>http://www.stuartdenman.com/template-friend-from-namespace/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 03:41:20 +0000</pubDate>
		<dc:creator>stu</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.stuartdenman.com/?p=259</guid>
		<description><![CDATA[If you have a namespaced-class and a template class defined like this: namespace Frog { class A { }; } template&#60;class T&#62; class B { }; Now suppose you wish the template class B to have access to private and protected members and methods of class A. Normally you&#8217;d add the following line of code [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a namespaced-class and a template class defined like this:</p>
<blockquote>
<pre>namespace Frog
{
    class A
    {
    };
}

template&lt;class T&gt;
class B
{
};</pre>
</blockquote>
<p>Now suppose you wish the template class B to have access to private and protected members and methods of class A. Normally you&#8217;d add the following line of code to the declaration of class A:</p>
<blockquote>
<pre>template&lt;class T&gt; friend class B;</pre>
</blockquote>
<p>However, in this case the compiler may object when a method in class B tries to access protected or private areas in class A. In this case, your compiler is probably thinking that your template friend class B is actually in the namespace Frog, even if class B is declared globally and before Frog::A is declared.</p>
<p>To fix this, simply tell the compiler that class B falls in the global namespace, like this:</p>
<blockquote>
<pre>template&lt;class T&gt; friend class ::B;</pre>
</blockquote>
<p>Notice I just added a double colon (::) before B&#8217;s name.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartdenman.com%2Ftemplate-friend-from-namespace%2F&amp;title=C%2B%2B%3A%20Using%20template%20friend%20from%20a%20namespace" id="wpa2a_16"><img src="http://www.stuartdenman.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartdenman.com/template-friend-from-namespace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenGL Frame Capture Tips</title>
		<link>http://www.stuartdenman.com/opengl-frame-capture-tips/</link>
		<comments>http://www.stuartdenman.com/opengl-frame-capture-tips/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 19:23:16 +0000</pubDate>
		<dc:creator>stu</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[3D graphics]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[opengl]]></category>
		<category><![CDATA[rendering]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.stuartdenman.com/?p=242</guid>
		<description><![CDATA[In Xcode version 4.2 and above, there&#8217;s a very nice  feature to capture OpenGL rendering commands from your game as it runs on an iOS device. I use the OpenGL ES 2.0 API, but it works the same in ES 1.1. Here are some helpful tips that I&#8217;ve discovered. I bumbled through these issues myself, [...]]]></description>
			<content:encoded><![CDATA[<p>In Xcode version 4.2 and above, there&#8217;s a very nice  feature to capture OpenGL rendering commands from your game as it runs on an iOS device. I use the OpenGL ES 2.0 API, but it works the same in ES 1.1. Here are some helpful tips that I&#8217;ve discovered. I bumbled through these issues myself, so these will hopefully save you some time.</p>
<ol>
<li><strong>Only render the objects that you are debugging.</strong> In Xcode 4.2, capturing a frame consumes a TON of memory if you have a lot of objects. For example, my game renders about 50 objects, each with approximately 2000 vertices and this will consume gigabytes of memory. So unless you enjoy trying to end tasks while your Mac is completely unresponsive, hide all but the objects that you are investigating. On the Apple Developer Forums, I was told that this issue has been improved in Xcode 4.3.</li>
<li><strong>Group your commands.</strong> There&#8217;s a handy debug extension you can call to mark the start and end of a group of rendering commands. Rendering a single primitive like a triangle strip, even if it is one object, involves setting a lot of attributes and uniforms and possibly changing blend modes. You can group all these commands together in the debugger by first calling <span class="code"><a href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_debug_marker.txt" target="_blank">glPushGroupMarkerEXT</a>(0,&#8221;Name&#8221;)</span> before issuing the commands and then <span class="code"><a href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_debug_marker.txt" target="_blank">glPopGroupMarkerEXT</a>()</span> after. You can also group objects together in the same way to create a hierarchy in the tool&#8217;s interface.</li>
<li><strong>Label your resources.</strong> When you create a texture or vertex buffer, you can attach a friendly name to it so that it doesn&#8217;t appear as &#8220;Texture #28.&#8221;  This is done using the <span class="code"><a href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_debug_label.txt" target="_blank">glLabelObjectEXT</a>()</span>function. Here&#8217;s how to do it for a texture:<br/><br/>
<p><span class="code">glLabelObjectEXT(GL_TEXTURE, texture.glid, 0, texture.name)</span></p>
<p>where <em>texture.glid</em> is the GL texture identifier returned from <span class="code">glGenTextures()</span> and <em>texture.name</em> is a null-terminated char string. One important tip here is that you can&#8217;t call this until you&#8217;ve actually created your texture using <span class="code">glTexImage2D()</span>. Otherwise you&#8217;ll get an error returned.</li>
</ol>
<h3>Command Grouping</h3>
<p style="text-align: center;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/04/GL-Capture-Groups.png"><img class="aligncenter size-full wp-image-249" title="GL-Capture - Groups" src="http://www.stuartdenman.com/wp-content/uploads/2012/04/GL-Capture-Groups.png" alt="" width="600" height="334" /></a></p>
<h3 style="text-align: left;">Resource Labels</h3>
<p style="text-align: center;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/04/GL-Capture-Labels.png"><img class="aligncenter size-full wp-image-250" title="GL-Capture - Labels" src="http://www.stuartdenman.com/wp-content/uploads/2012/04/GL-Capture-Labels.png" alt="" width="380" height="142" /></a></p>
<p style="text-align: center;">
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartdenman.com%2Fopengl-frame-capture-tips%2F&amp;title=OpenGL%20Frame%20Capture%20Tips" id="wpa2a_18"><img src="http://www.stuartdenman.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartdenman.com/opengl-frame-capture-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improved Color Blending</title>
		<link>http://www.stuartdenman.com/improved-color-blending/</link>
		<comments>http://www.stuartdenman.com/improved-color-blending/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 09:08:54 +0000</pubDate>
		<dc:creator>stu</dc:creator>
				<category><![CDATA[All Posts]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Graphics]]></category>

		<guid isPermaLink="false">http://www.stuartdenman.com/?p=149</guid>
		<description><![CDATA[Linear RGB color interpolation is not as great as its popularity would make it out to be. In this post I introduce blending in the CIE-LCh color-space, which is dramatically better for certain applications. NOTE: you may want to read my article on Twisted Hue Lighting before reading this post. Background and Issues The standard [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #000000;">Linear RGB color interpolation is not as great as its popularity would make it out to be. In this post I introduce blending in the CIE-LCh color-space, which is dramatically better for certain applications.</span></p>
<p><span style="color: #999999;"><em>NOTE: you may want to read my article on </em></span><em><a title="Twisted-Hue Lighting" href="http://www.stuartdenman.com/twisted-hue-lighting/">Twisted Hue Lighting</a></em><span style="color: #999999;"><em> before reading this post.</em></span></p>
<h2>Background and Issues</h2>
<p>The standard way to blend between two colors (C1 and C2) is just to linearly interpolate each red, green, and blue component according to the following formulas:</p>
<blockquote>
<pre>R' = R1 + <em>f</em> * (R2 - R1)
G' = G1 + <em>f</em> * (G2 - G1)
B' = B1 + <em>f</em> * (B2 - B1)</pre>
</blockquote>
<p>Where <em>f</em> is a fraction the range [0,1]. When <em>f</em> is 0, our result is 100% C1, and when <em>f</em> is 1, our result is 100% C2. Simple enough. If we sample 7 points along this range, it produces a gradient, such as this one:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/Screen-shot-2012-03-29-at-6.20.10-PM.png"><img class="aligncenter size-full wp-image-150" title="Linear Gradient" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/Screen-shot-2012-03-29-at-6.20.10-PM.png" alt="" width="290" height="44" /></a></p>
<p>If you visualize RGB color-space as a <a title="RGB 3D Cube" href="http://commons.wikimedia.org/wiki/File%3ARGB_Cube_Show_lowgamma_cutout_a.png" target="_blank">3D cube</a> (one axis for each component), then this blend is just taking uniform color samples along a line that connects the two color points within that space (hence the term &#8220;linear&#8221; interpolation).</p>
<p>This technique is used a lot in games, for example if you have a changing dynamic light source &#8211; like the light from a setting sun. Or perhaps you&#8217;ve got an particle effect that blends from one color to another. The code for this is fairly cheap to run. However, depending on your art style, a linear blend in RGB color-space may not always be the best choice. Suppose we do the same blend as above, but with blue as the starting color:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/Screen-shot-2012-03-29-at-5.53.57-PM.png"><img class="aligncenter size-full wp-image-151" title="Blue-to-Yellow Gradient" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/Screen-shot-2012-03-29-at-5.53.57-PM.png" alt="" width="290" height="44" /></a></p>
<p>Observant readers will notice something a bit strange about this gradient. The middle color, where <em>f</em>=0.5, is gray. It has no color at all. We can measure the saturation of these colors (by converting them to the HSB color-space), with the following result:</p>
<pre style="text-align: center; margin-bottom: 12px;">[1.0] [0.8] [0.5] [0.0] [0.5] [0.8] [1.0]</pre>
<p>The brightness also changes in a similar way &#8211; it is not linear across this gradient.</p>
<p>In some applications, you may want to <strong>maintain color saturation</strong>, especially if you&#8217;re using these colors as a diffuse material color. It changes the characteristics of a scene dramatically when the saturation (color) goes away and the brightness is cut in half, such as when the middle color became gray in the blue-to-yellow example above. In the real world, a dramatic sunset is created by the particles in the air refracting the sunlight into wavelengths that create colors of yellow, orange, red, purple, and blue. The colors are blended in the same way a rainbow sends various wavelengths of light into your eye.</p>
<h2>Polar Color-Space Interpolation</h2>
<p>If your goal is to maintain color saturation and brightness, you can perform the interpolation in a polar-coordinate color space. Instead of the cube-shaped space of RGB, polar color spaces are cylindrical or conical in shape. Examples of polar coordinate spaces include HSB (also called HSV), HSL and CIE-LCh. <span style="color: #808080;">*</span></p>
<p style="padding-left: 30px;"><span style="color: #808080; font-size: 0.8em;">* Technically HSB is a hexagonal cone shape, but we can consider that it approximates a circular cone.</span></p>
<p>To blend in HSB space, for example, you need to first convert each RGB color to an HSB color. For code to convert colors, follow the link at the end of this article. The code isn&#8217;t free, so don&#8217;t use it on 10,000 particles, but later I&#8217;ll show ways to optimize this.  Once you have two HSB colors, their saturation and brightness can be interpolated linearly, using the same formulas that I introduced at the beginning of this article. The hue component is an angle around a circle, so you need to handle the discontinuity from 360 to 0 degrees and interpolate the shortest route around the circumference. Here is the algorithm as pseudo-code:</p>
<blockquote>
<pre>d = h2 - h1
if (h1 &gt; h2) then swap(h1, h2), d = -d, f = 1 - f
if (d &gt; 180) then h1 = h1 + 360, h = ( h1 + f * (h2 - h1) ) mod 360
if (d &lt;= 180) then h = h1 + f * d</pre>
</blockquote>
<p>Here I&#8217;m assuming that the hue ranges from [0, 360), but some implementations use [0, 1), so adjust accordingly. Using the blue-to-yellow example, we now get:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/HSB-Blue-To-Yellow.png"><img class="aligncenter size-full wp-image-228" title="HSB-Blue-To-Yellow" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/HSB-Blue-To-Yellow.png" alt="" width="290" height="44" /></a></p>
<p>If the two colors have the same saturation and brightness (they do in the above example), this interpolation will just rotate around the circumference, taking the shortest path (could be clockwise or counter-clockwise). Notice the color saturation is maintained through the entire gradient.</p>
<p>One issue with the HSB color-space is that it doesn&#8217;t do a great job of representing brightness as our eye sees it. The disadvantages of HSV and HSL are explained very well in <a title="Disadvantages of HSV and HSL" href="http://en.wikipedia.org/wiki/HSL_and_HSV#Disadvantages" target="_blank">this</a> Wikipedia article. In the above gradient, the blue on the left is perceptually much darker than the yellow on the right, even though in HSB, the brightness component is 1.0 over the entire gradient. The brightness is also inconsistent across the gradient, and the greens are too close to one another in color.</p>
<h2>Perception Rules</h2>
<p>To solve this, we can do the interpolation in a different polar color space. The CIE-LCh color-space is similar in geometry and function to HSB, but takes into account human perception of color differences. It is a polar-coordinate version of the CIE-Lab color-space. I&#8217;ve put together a <a href="/tools/polar-gamuts/" target="_blank">simple page</a> so you can see the difference in the two color-spaces side-by-side.</p>
<p>Here is a blend of the same blue and yellow used above, but interpolated in CIE-LCh color-space:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-LCh.png"><img class="aligncenter size-full wp-image-180" title="CIE-LCh Gradient" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-LCh.png" alt="" width="290" height="44" /></a></p>
<p>Great! This time perceived brightness appears to change uniformly across the gradient.</p>
<p>Converting from RGB to CIE-LCh is not cheap: it requires converting RGB to XYZ, then XYZ to CIE-Lab, and finally CIE-Lab to CIE-LCh. After you compute the interpolated colors, you need RGB values to render the colors onto the screen. This means you have to reverse this conversion for each color along the gradient.</p>
<h2>Approximation Trick</h2>
<p>If you are generating a gradient with a lot of steps, you don&#8217;t have to do this conversion at every step. You can approximate the CIE-LCh interpolation by converting only a subset of steps back to RGB and then interpolate in RGB-space using the old school technique. If you just do this with the halfway point (<em>f</em>=0.5), for example, your cost is only 2 conversions to CIE-LCh space and 1 conversion back to RGB space. The rough approximation looks pretty close to our CIE-LCh result above:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-LCh-Approx.png"><img class="aligncenter size-full wp-image-212" title="CIE-LCh Approximated Interpolation" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-LCh-Approx.png" alt="" width="290" height="44" /></a></p>
<h2>What About CIE-Lab Space?</h2>
<p>Even though CIE-Lab is a perceptual-based color-space, linear interpolations within it do not maintain saturation, even though brightness is uniformly blended. Here&#8217;s an example, showing the same gray problem:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-Lab-Orange-To-Blue.png"><img class="aligncenter size-full wp-image-216" title="CIE-Lab-Orange-To-Blue" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-Lab-Orange-To-Blue.png" alt="" width="290" height="44" /></a></p>
<p>Compared to the interpolation in CIE-LCh where saturation and brightness are uniform:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-LCh-Orange-To-Blue.png"><img class="aligncenter size-full wp-image-217" title="CIE-LCh-Orange-To-Blue" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-LCh-Orange-To-Blue.png" alt="" width="290" height="44" /></a></p>
<p>For an interesting comparison, here&#8217;s the same interpolation in HSB space:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/HSB-Orange-To-Blue1.png"><img class="aligncenter size-full wp-image-230" title="HSB-Orange-To-Blue" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/HSB-Orange-To-Blue1.png" alt="" width="290" height="44" /></a></p>
<p>And in RGB space:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/RGB-Orange-To-Blue.png"><img class="aligncenter size-full wp-image-219" title="RGB-Orange-To-Blue" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/RGB-Orange-To-Blue.png" alt="" width="290" height="44" /></a></p>
<h2>Final Comparison</h2>
<p>Here are all the gradients of blue-to-yellow for comparison purposes:</p>
<p><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/Screen-shot-2012-03-29-at-5.53.57-PM.png"><img class="aligncenter size-full wp-image-151" title="Blue-to-Yellow Gradient" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/Screen-shot-2012-03-29-at-5.53.57-PM.png" alt="" width="290" height="44" /></a><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/HSB-Blue-To-Yellow.png"><img class="aligncenter size-full wp-image-228" title="HSB-Blue-To-Yellow" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/HSB-Blue-To-Yellow.png" alt="" width="290" height="44" /></a><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-LCh.png"><img class="aligncenter size-full wp-image-180" title="CIE-LCh Gradient" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-LCh.png" alt="" width="290" height="44" /></a></p>
<p style="text-align: left;">Row 1: <strong>RGB</strong> Interpolation<br />
Row 2: <strong>HSB</strong> Interpolation<br />
Row 3: <strong>CIE-LCh</strong> Interpolation</p>
<p style="text-align: left;">Here is a cyan-to-red interpolation that also exhibits the gray problem in RGB space:</p>
<p style="text-align: left;"><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/Screen-shot-2012-03-30-at-12.05.12-AM.png"><img class="aligncenter size-full wp-image-185" title="Cyan-To-Red RGB Interpolation" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/Screen-shot-2012-03-30-at-12.05.12-AM.png" alt="" width="290" height="44" /></a><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/HSB-Cyan-To-Red.png"><img class="aligncenter size-full wp-image-234" title="HSB-Cyan-To-Red" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/HSB-Cyan-To-Red.png" alt="" width="290" height="44" /></a><a href="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-LCh-Cyan-To-Red.png"><img class="aligncenter size-full wp-image-187" title="Cyan-To-Red CIE-LCh Interpolation" src="http://www.stuartdenman.com/wp-content/uploads/2012/03/CIE-LCh-Cyan-To-Red.png" alt="" width="290" height="44" /></a></p>
<p style="text-align: left;">It is a dramatic example of the improved quality that you can get by interpolating in the CIE-LCh color-space.</p>
<p style="text-align: left;">In a future post, I&#8217;ll talk about how to do a weighted-blend of an arbitrary number of colors in polar coordinate systems.</p>
<h2>Open-Source Code Examples</h2>
<p>Example code to convert RGB color to HSB and back (C/C++): <a href="http://stackoverflow.com/questions/3018313/algorithm-to-convert-rgb-to-hsv-and-hsv-to-rgb" target="_blank">Stack Overflow</a></p>
<p>ColorJizz color conversion library (AS3, PHP, Javascript, C#): <a href="http://code.google.com/p/colorjizz/" target="_blank">Google Code</a></p>
<p>&nbsp;</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartdenman.com%2Fimproved-color-blending%2F&amp;title=Improved%20Color%20Blending" id="wpa2a_20"><img src="http://www.stuartdenman.com/wp-content/plugins/add-to-any/share_save_256_24.png" width="256" height="24" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartdenman.com/improved-color-blending/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
