<?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>pixelplacement.com</title>
	<atom:link href="http://pixelplacement.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://pixelplacement.com</link>
	<description>The digital works of Bob Berkebile</description>
	<lastBuildDate>Wed, 02 May 2012 19:56:40 +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>Simple State Saving</title>
		<link>http://pixelplacement.com/2012/03/21/simple-state-saving/</link>
		<comments>http://pixelplacement.com/2012/03/21/simple-state-saving/#comments</comments>
		<pubDate>Wed, 21 Mar 2012 04:52:52 +0000</pubDate>
		<dc:creator>pixelplacement</dc:creator>
				<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://pixelplacement.com/?p=1096</guid>
		<description><![CDATA[Saving the state of a GameObject(read MonoBehavior) via traditional serialization is not possible so I whipped up a simple approach that allows easy saving and loading of data contained in a class for simple state storage and retrieval via PlayerPrefs. First, create a super-simple, serializable class that you can use as your data container in [...]]]></description>
			<content:encoded><![CDATA[<p><div class="frame_right"><a href="http://pixelplacement.com/wp-content/uploads/2012/03/StateStorageExample.jpg" class="img_frame"><img src="http://pixelplacement.com/wp-content/themes/Jing/Jing/timthumb.php?src=wp-content/uploads/2012/03/StateStorageExample.jpg&#038;h=131&#038;w=180&#038;zc=1" alt=""/></a><span class="caption">Easily save the state of a GameObject</span></div>Saving the state of a GameObject(read MonoBehavior) via traditional serialization is not possible so I whipped up a simple approach that allows easy saving and loading of data contained in a class for simple state storage and retrieval via PlayerPrefs.</p>
<p>First, create a super-simple, serializable class that you can use as your data container in your GameObject:</p>
<pre>
[System.Serializable]
public class HeroStats{
	public float health;
	public float magic;
	public float money;
	public bool talkedToWizard;
	public bool defeatedRedDragon;
	public bool hasMagicKey;
}
</pre>
<p>Next add an instance of this class to your GameObject as a replacement for anything specific to runtime operation/progress.  I typically make this field public so I can monitor and observe things easier in the inspector and load and save to this field as needed.  Here&#8217;s an example that leverages OnEnable and OnDisable to automatically load and save the state of a GameObject using the values in the HeroStats class from above:</p>
<pre>
using UnityEngine;
using System.Collections;

public class Hero : MonoBehaviour {

	public HeroStats stats;

	void OnEnable(){
		stats = StateStorage.LoadData< HeroStats >( "MainHeroStats" );
	}

	void OnDisable(){
		StateStorage.SaveData< HeroStats >( "MainHeroStats", stats );
	}

}
</pre>
<p>The string values required in the LoadData and SaveData methods are merely references to the PlayerPrefs key that your data will be saved to.  I considered making this automated but if multiple objects shared a stats class you would have problems (from this example, what if we had multiple heroes?). I also included a simple wrapper for PlayerPrefs&#8217; DeleteKey method to unify this interface called ClearData.  I don&#8217;t think you can use generics with UnityScript (which is required so proper serialization and deserialization of your stat class can occur) so I think this approach is strictly for the C# crowd (they are cooler anyway).</p>
<p>If you ever encounter an error: &#8220;InvalidOperationException: < CLASSNAME xmlns='' > was not expected&#8230;&#8221; you renamed the name of the class you were saving into PlayerPrefs.  A simple save of data to the same key with the new class name in PlayerPrefs will fix everything.</p>
<p><a href="http://pixelplacement.com/wp-content/uploads/2012/03/StateStorage.unitypackage"><img src="http://pixelplacement.com/wp-content/uploads/2012/03/DownloadLink.png" alt="" title="Download" width="293" height="95" class="alignnone size-full wp-image-843" /></a></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Simple+State+Saving+http%3A%2F%2Fis.gd%2FKjCsqx" title="Post to Twitter"><img class="nothumb" src="http://pixelplacement.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://pixelplacement.com/2012/03/21/simple-state-saving/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The best darn throwable object spinner</title>
		<link>http://pixelplacement.com/2012/03/09/the-best-darn-throwable-object-spinner/</link>
		<comments>http://pixelplacement.com/2012/03/09/the-best-darn-throwable-object-spinner/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 05:11:35 +0000</pubDate>
		<dc:creator>pixelplacement</dc:creator>
				<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://pixelplacement.com/?p=1070</guid>
		<description><![CDATA[Nothing more I can say about this release other than its a draggable object rotator that supports extremely responsive throw mechanics. Plop it on an object (don&#8217;t forget a collider to allow touch interaction), touch and drag on the model on your mobile device to rotate the model around and flick your finger to send [...]]]></description>
			<content:encoded><![CDATA[<p>Nothing more I can say about this release other than its a draggable object rotator that supports extremely responsive throw mechanics.  Plop it on an object (don&#8217;t forget a collider to allow touch interaction), touch and drag on the model on your mobile device to rotate the model around and flick your finger to send it spinning with extremely natural velocity.</p>
<p>Don&#8217;t forget to set your frame rate to 60 FPS with Application.targetFrameRate = 60 to ensure silky smooth response.  </p>
<p>This solution has an expectation barrier in that rotation is based on the object&#8217;s x and y axis and not camera/screen space.  If I develop a clearer approach I&#8217;ll release an update but the solution provided should be a great jumping off point for the problem it solves.</p>
<p><a href="http://pixelplacement.com/wp-content/uploads/2012/03/DraggableObjectSpinner.unitypackage"><img src="http://pixelplacement.com/wp-content/uploads/2012/03/DownloadLink.png" alt="" title="Download" width="293" height="95" class="alignnone size-full wp-image-843" /></a></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=The+best+darn+throwable+object+spinner+http%3A%2F%2Fis.gd%2FD2Ak7l" title="Post to Twitter"><img class="nothumb" src="http://pixelplacement.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://pixelplacement.com/2012/03/09/the-best-darn-throwable-object-spinner/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Unity needed cmd-g and ctrl-g</title>
		<link>http://pixelplacement.com/2012/03/04/unity-needed-cmnd-g-and-ctrl-g/</link>
		<comments>http://pixelplacement.com/2012/03/04/unity-needed-cmnd-g-and-ctrl-g/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 05:46:50 +0000</pubDate>
		<dc:creator>pixelplacement</dc:creator>
				<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://pixelplacement.com/?p=1054</guid>
		<description><![CDATA[I&#8217;ve found my left hand hitting the trusty &#8220;make group&#8221; key combination in Unity more and more whenever I&#8217;m deeply focused on organizing and structuring scene objects and I&#8217;ve had it with disappointment. Create an empty game object, put it where I need it, plop children under said new empty game object is so yesterday [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found my left hand hitting the trusty &#8220;make group&#8221; key combination in Unity more and more whenever I&#8217;m deeply focused on organizing and structuring scene objects and I&#8217;ve had it with disappointment.  Create an empty game object, put it where I need it, plop children under said new empty game object is so yesterday when it comes to organizing in Unity now.  Drop my new group maker into your unity projects and organization is a simple press of command-g (control-g on PC) away!</p>
<p>The object showing in your scene view with a transform gizmo attached when you hit command-g (control-g on PC) is where the pivot is set.  This means if you are using command-click (control-click on PC) to select objects to group the first object you chose will end up begin the pivot.</p>
<p><a href="http://pixelplacement.com/wp-content/uploads/2012/03/Group.unitypackage"><img src="http://pixelplacement.com/wp-content/uploads/2012/03/GroupDownloadLink.png" alt="" title="GetGroup" width="293" height="95" class="alignnone size-full wp-image-843" /></a></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Unity+needed+cmd-g+and+ctrl-g+http%3A%2F%2Fis.gd%2FY0ZcKT" title="Post to Twitter"><img class="nothumb" src="http://pixelplacement.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://pixelplacement.com/2012/03/04/unity-needed-cmnd-g-and-ctrl-g/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Debugging Unity on Android</title>
		<link>http://pixelplacement.com/2012/02/18/debugging-unity-on-android/</link>
		<comments>http://pixelplacement.com/2012/02/18/debugging-unity-on-android/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 03:57:04 +0000</pubDate>
		<dc:creator>pixelplacement</dc:creator>
				<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://pixelplacement.com/?p=1019</guid>
		<description><![CDATA[Just wanted to document the steps for how to monitor debug messages and such for a running Unity application on Android for Mac: Step 1: Open up a Terminal window. Step 2: In Finder locate the adb application in the Android SDK (under platform-tools as of writing this). Step 3: Drag the adb application into [...]]]></description>
			<content:encoded><![CDATA[<p>Just wanted to document the steps for how to monitor debug messages and such for a running Unity application on Android for Mac:</p>
<h4>Step 1:</h4>
<p>Open up a Terminal window.</p>
<h4>Step 2:</h4>
<p>In Finder locate the adb application in the Android SDK (under platform-tools as of writing this).</p>
<h4>Step 3:</h4>
<p>Drag the adb application into your terminal window to autocomplete the path.</p>
<h4>Step 4:</h4>
<p>Add &#8220;logcat -s Unity&#8221; after the adb application path (without the quotes). Your command should now look similar to: &#8230;android-sdk-macosx/platform-tools/adb logcat -s Unity OR just add &#8220;logcat&#8221; to gain access to everything the device is sending in case you need more detail.</p>
<h4>Step 5:</h4>
<p>Press return and get your debug on.</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Debugging+Unity+on+Android+http%3A%2F%2Fis.gd%2FNOVxZh" title="Post to Twitter"><img class="nothumb" src="http://pixelplacement.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://pixelplacement.com/2012/02/18/debugging-unity-on-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LayerMasks simplified</title>
		<link>http://pixelplacement.com/2012/01/31/layermasks-simplified/</link>
		<comments>http://pixelplacement.com/2012/01/31/layermasks-simplified/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 04:25:22 +0000</pubDate>
		<dc:creator>pixelplacement</dc:creator>
				<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://pixelplacement.com/?p=1000</guid>
		<description><![CDATA[I love LayerMasks because of their power and ability to filter things. I hate LayerMasks because I can never remember how to properly create them in code. To end this love/hate relationship I finally sat down and made a solution that&#8217;s incredibly simple and invaluable for taming LayerMasks. You too can now punch LayerMasks in [...]]]></description>
			<content:encoded><![CDATA[<p>I love LayerMasks because of their power and ability to filter things.  I hate LayerMasks because I can never remember how to properly create them in code.  To end this love/hate relationship I finally sat down and made a solution that&#8217;s incredibly simple and invaluable for taming LayerMasks.  You too can now punch LayerMasks in their confusing face.</p>
<pre>//Set a camera to only look at layer 7:
void Awake (){
	//by layer id:
	camera.cullingMask = LayerMaskHelper.OnlyIncluding( 7 );

	//or by layer name:
	camera.cullingMask = LayerMaskHelper.OnlyIncluding( LayerMask.NameToLayer("UserInterface") );
}

//Set a light to affect layers 4, 8 and 11:
void Awake (){
	//LayerMaskHelper doesn't care if you give them in order
	//by id:
	light.cullingMask = LayerMaskHelper.OnlyIncluding( 4, 11, 8 ); 

	//or by layer names:
	light.cullingMask = LayerMaskHelper.OnlyIncluding( LayerMask.NameToLayer("Landscape"), LayerMask.NameToLayer("Player"), LayerMask.NameToLayer("Enemies") );
}

//Set a light to affect everything except for layers 5 and 6:
void Awake (){
	//by layer id:
	light.cullingMask = LayerMaskHelper.EverythingBut( 5, 6 );

	//or by layer names:
	light.cullingMask = LayerMaskHelper.EverythingBut( LayerMask.NameToLayer("Landscape"), LayerMask.NameToLayer("Player") );
}
</pre>
<p><a href="http://pixelplacement.com/wp-content/uploads/2012/01/LayerMaskHelper.unitypackage"><img src="http://pixelplacement.com/wp-content/uploads/2012/01/GetLayerMaskHelper.png" alt="" title="GetStringManager" width="293" height="95" class="alignnone size-full wp-image-843" /></a></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=LayerMasks+simplified+http%3A%2F%2Fis.gd%2FLb1E2K" title="Post to Twitter"><img class="nothumb" src="http://pixelplacement.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://pixelplacement.com/2012/01/31/layermasks-simplified/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bully! Entertainment Developer Profile</title>
		<link>http://pixelplacement.com/2011/10/05/bully-entertainment-developer-profile/</link>
		<comments>http://pixelplacement.com/2011/10/05/bully-entertainment-developer-profile/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 04:29:42 +0000</pubDate>
		<dc:creator>pixelplacement</dc:creator>
				<category><![CDATA[General Babble]]></category>

		<guid isPermaLink="false">http://pixelplacement.com/?p=952</guid>
		<description><![CDATA[I was recently featured in a developer profile by Unity Tech for our work with the Unity 3D platform.]]></description>
			<content:encoded><![CDATA[<p>I was recently featured in a developer profile by Unity Tech for our work with the Unity 3D platform.</p>
<p>
<object style="width:648px; height:407px;">
<param name="movie" value="http://www.youtube.com/v/7JwOurAUEpo?version=3" />
<param name="allowScriptAccess" value="always" />
<param name="wmode" value="window" />
<param name="allowFullScreen" value="true" />
<embed src="http://www.youtube.com/v/7JwOurAUEpo?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" wmode="window" width="648" height="407"></object>
</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Bully%21+Entertainment+Developer+Profile+http%3A%2F%2Fis.gd%2FxoO7p3" title="Post to Twitter"><img class="nothumb" src="http://pixelplacement.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://pixelplacement.com/2011/10/05/bully-entertainment-developer-profile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Talking at Unite 11</title>
		<link>http://pixelplacement.com/2011/10/05/talking-unity/</link>
		<comments>http://pixelplacement.com/2011/10/05/talking-unity/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 01:15:11 +0000</pubDate>
		<dc:creator>pixelplacement</dc:creator>
				<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://pixelplacement.com/?p=940</guid>
		<description><![CDATA[I recently spoke at Unite 11 on behalf of Bully! Entertainment about our augmented reality work we did for Ford. You can check out the Unity powered presentation I created for my talk and ran off my iPad here.]]></description>
			<content:encoded><![CDATA[<p>I recently spoke at Unite 11 on behalf of Bully! Entertainment about our augmented reality work we did for Ford.  You can check out the Unity powered presentation I created for my talk and ran off my iPad <a href="http://pixelplacement.com/unite2011/">here</a>.</p>
<p>
<object style="width:648px; height:407px;">
<param name="movie" value="http://www.youtube.com/v/mjGuaI7l00w?version=3" />
<param name="allowScriptAccess" value="always" />
<param name="wmode" value="window" />
<param name="allowFullScreen" value="true" />
<embed src="http://www.youtube.com/v/mjGuaI7l00w?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" wmode="window" width="648" height="407"></object>
</p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Talking+at+Unite+11+http%3A%2F%2Fis.gd%2F9KIMvi" title="Post to Twitter"><img class="nothumb" src="http://pixelplacement.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://pixelplacement.com/2011/10/05/talking-unity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing String Manager</title>
		<link>http://pixelplacement.com/2011/07/14/introducing-string-manager/</link>
		<comments>http://pixelplacement.com/2011/07/14/introducing-string-manager/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 04:33:22 +0000</pubDate>
		<dc:creator>pixelplacement</dc:creator>
				<category><![CDATA[Augmented Reality]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://pixelplacement.com/?p=777</guid>
		<description><![CDATA[Attention: String Manager has recently been refactored with expanded functionality for even easier usage and has shaved off 178KB from your final build size. If you are using an older version please delete the previous version&#8217;s folder and install the new version available from the download link below. I&#8217;ve finally decided to compile some of [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: yellow;">Attention: String Manager has recently been refactored with expanded functionality for even easier usage and has shaved off 178KB from your final build size. If you are using an older version please delete the previous version&#8217;s folder and install the new version available from the download link below.</span></p>
<p><div class="frame_left"><a href="http://pixelplacement.com/wp-content/uploads/2011/07/StringManagerPreview.jpg" class="img_frame"><img src="http://pixelplacement.com/wp-content/themes/Jing/Jing/timthumb.php?src=wp-content/uploads/2011/07/StringManagerPreview.jpg&#038;h=131&#038;w=180&#038;zc=1" alt=""/></a><span class="caption">Making String that much easier.</span></div>I&#8217;ve finally decided to compile some of my tricks and techniques that I often integrate into one of String&#8217;s two managers into the end-all, be-all manager component for working with String.  This new component should be added to your camera just as with either the CameraCentric or ContentCentric managers &#8211; or not if you want it to yell at you &#8211; and is a complete replacement for using them.  In addition to allowing easier swapping between the two styles of tracking, this new manager also empowers you with some battle-tested techniques that will help you concentrate on content rather than augmented reality while pulling the most out of String&#8217;s features.</p>
<p>Usage is simple, first select a style which is identical to choosing between String&#8217;s out-of-the-box, bare-bones managers. After a style is set, String Manager will automatically adjust itself to offer parameters specific to each style.  I don&#8217;t think documentation is required for the options and root objects section of the tool (if I&#8217;m wrong let me know) and live light color sampling is easily accessible with the usage of the new GetSampledColor() method allowing color retrieval by augmentation id (which directly corresponds to the element id in your Root Objects list) or by a string name for the augmentation.  Please note usage of live color sampling with String is only available on device in Developer, Pro and Campaign licenses.</p>
<p><span style="color: yellow;">Please note String Manager has recently been ported over to a singleton pattern for super-simple, global access.  If you are unfamiliar with how singletons work all you need to know is that if you want to access any of its methods just add a call to &#8220;Instance&#8221; after the name: StringManager.Instance.GetSampledColor().  In addition, I also added three events that you can subscribe to in order to respond to the acquiring and loss of markers: OnMarkerFound, OnMarkerLost and OnDisabled.  If you are unfamiliar with events watch <a href="http://www.youtube.com/watch?v=N2zdwKIsXJs" title="Prime31's Tutorial on C# Events" target="_blank">Prime 31&#8242;s great tutorial on this powerful feature</a>.</span></p>
<p>Examples for applying sampled color light from String:</p>
<pre>//Application of light color setting on a Directional Light by root object id:
void Update (){
	light.color = StringManager.Instance.GetSampledColor(0);
}
</pre>
<p></p>
<pre>//Application of light color setting on a Directional Light by root object name:
void Update (){
	light.color = StringManager.Instance.GetSampledColor("MyAugmentedObject");
}
</pre>
<p></p>
<pre>//Application of light color setting to a material's Main Color by root object id:
void Update (){
	renderer.material.SetColor("_Color", StringManager.Instance.GetSampledColor(0));
}
</pre>
<p>Post any problems you encounter and keep in mind you will eventually outgrow this manager. New challenges will always require custom managers so keep the template managers String provides so you can extend your own possibilities beyond this tool once your experience grows.</p>
<p><a href="http://pixelplacement.com/wp-content/uploads/2011/07/StringManager.unitypackage"><img src="http://pixelplacement.com/wp-content/uploads/2011/07/GetStringManager.png" alt="" title="GetStringManager" width="293" height="95" class="alignnone size-full wp-image-843" /></a></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Introducing+String+Manager+http%3A%2F%2Fis.gd%2FwYtk9S" title="Post to Twitter"><img class="nothumb" src="http://pixelplacement.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://pixelplacement.com/2011/07/14/introducing-string-manager/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Tunneling in Augmented Reality</title>
		<link>http://pixelplacement.com/2011/06/24/tunneling-in-augmented-reality/</link>
		<comments>http://pixelplacement.com/2011/06/24/tunneling-in-augmented-reality/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 00:56:43 +0000</pubDate>
		<dc:creator>pixelplacement</dc:creator>
				<category><![CDATA[Augmented Reality]]></category>
		<category><![CDATA[ar]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[sample project]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://pixelplacement.com/?p=742</guid>
		<description><![CDATA[A magician never reveals his secrets&#8230; most of the time. Since this post I did on augmented reality I&#8217;ve received a ton of requests for how to pull off tunneling and penetration effects in augmented reality. This blog post marks my giving in on trying to keep this effect a secret and I&#8217;m giving away [...]]]></description>
			<content:encoded><![CDATA[<p>A magician never reveals his secrets&#8230; most of the time.</p>
<p>Since <a href="http://pixelplacement.com/2011/02/28/maximizing-mobile-augmented-reality/">this post</a> I did on augmented reality I&#8217;ve received a ton of requests for how to pull off tunneling and penetration effects in augmented reality.  This blog post marks my giving in on trying to keep this effect a secret and I&#8217;m giving away a sample of how to pull off tunneling in Unity with depth masking.  While this effect is geared towards augmented reality I hope the depth masking technique I used opens the flood gates of creativity for other effects.</p>
<p><div class="frame_left"><a href="http://pixelplacement.com/wp-content/uploads/2011/06/Tunneling.png" class="img_frame"><img src="http://pixelplacement.com/wp-content/themes/Jing/Jing/timthumb.php?src=wp-content/uploads/2011/06/Tunneling.png&#038;h=131&#038;w=180&#038;zc=1" alt=""/></a><span class="caption">Bending reality by tunneling.</span></div>Simply import the package below into Unity and take a<br />
look at the included prefab.  This example will work perfectly with both String and Qualcomm&#8217;s augmented reality solutions for Unity.</p>
<p>If you receive an &#8220;ImportFBX Warning&#8221; just ignore it.</p>
<p>(P.S. switch the Texture Format of the CasketShadow.png file to RGBA 32 bit to improve the appearance of the shadow around the rim of the opening)</p>
<p><a href="http://pixelplacement.com/wp-content/uploads/2011/06/TunnelingExample.unitypackage"><img src="http://pixelplacement.com/wp-content/uploads/2011/06/GetTunnelingExample.png" alt="" title="GetTunnelingExample" width="293" height="95" class="alignnone size-full wp-image-845" /></a></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Tunneling+in+Augmented+Reality+http%3A%2F%2Fis.gd%2F1UV7dY" title="Post to Twitter"><img class="nothumb" src="http://pixelplacement.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://pixelplacement.com/2011/06/24/tunneling-in-augmented-reality/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Simplifying Screen Positioning in Unity</title>
		<link>http://pixelplacement.com/2011/05/13/simplifying-screen-positioning-in-unity/</link>
		<comments>http://pixelplacement.com/2011/05/13/simplifying-screen-positioning-in-unity/#comments</comments>
		<pubDate>Fri, 13 May 2011 18:50:32 +0000</pubDate>
		<dc:creator>pixelplacement</dc:creator>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[interfce]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[unity]]></category>

		<guid isPermaLink="false">http://pixelplacement.com/?p=697</guid>
		<description><![CDATA[User interface resides in one of the nine sections of any screen it&#8217;s designed for: Upper Left, Upper Middle, Upper Right, etc. and maintaining consistant positioning for your UI while trying to centralize game code to be run on multiple device resolutions can be annoying and tedious. To help simplify screen positioning for UI and [...]]]></description>
			<content:encoded><![CDATA[<p><div class="frame_left"><a href="http://pixelplacement.com/wp-content/uploads/2011/05/ScreenPositionSample.png" class="img_frame"><img src="http://pixelplacement.com/wp-content/themes/Jing/Jing/timthumb.php?src=wp-content/uploads/2011/05/ScreenPositionSample.png&#038;h=131&#038;w=180&#038;zc=1" alt=""/></a><span class="caption">New demo scene included.</span></div>User interface resides in one of the nine sections of any screen it&#8217;s designed for: Upper Left, Upper Middle, Upper Right, etc. and maintaining consistant positioning for your UI while trying to centralize game code to be run on multiple device resolutions can be annoying and tedious.</p>
<p>To help simplify screen positioning for UI and any other elements I&#8217;ve put together a super simple C# extension for Unity that exposes a new method to Transform and GameObject called ScreenPlacement. I&#8217;ve also included a demo scene which shows how to position things perfectly as well as included a nice component called &#8220;ScreenPlacement&#8221; that you can put on any object to set it&#8217;s position visually in the editor.</p>
<p>Once added to your project, ScreenPlacement can easily be used to place things within one of the 9 sections of a screen:</p>
<pre>
//Place an object in the lower right of the screen:
transform.ScreenPlacement(ScreenPosition.LowerRight);

//Place an object in the lower right of the screen 60 pixels from the right and 20 pixels from the bottom:
transform.ScreenPlacement(ScreenPosition.LowerRight, new Vector2(60,20));
</pre>
<p>If you choose to use a camera other than the Main Camera for your UI to help stack aspects of your game display, pass that camera into ScreenPosition to ensure calculations are accurate to that camera:</p>
<pre>
//Place an object in the lower right of the screen using a camera other than Main Camera:
transform.ScreenPlacement(ScreenPosition.LowerRight, MyInterfaceCamera);

//Place an object in the lower right of the screen 60 pixels from the right and 20 pixels from the bottom using a camera other than Main Camera:
transform.ScreenPlacement(ScreenPosition.LowerRight, new Vector2(60,20), MyInterfaceCamera);
</pre>
<p><a href="http://www.pixelplacement.com/wp-content/uploads/2011/05/ScreenPlacement.unitypackage"><img src="http://pixelplacement.com/wp-content/uploads/2011/05/GetScreenPosition.png" alt="" title="GetScreenPosition" width="293" height="95" class="alignnone size-full wp-image-848" /></a></p>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Simplifying+Screen+Positioning+in+Unity+http%3A%2F%2Fis.gd%2Fjt3w6w" title="Post to Twitter"><img class="nothumb" src="http://pixelplacement.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://pixelplacement.com/2011/05/13/simplifying-screen-positioning-in-unity/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

