<?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>zupko.info</title>
	<atom:link href="http://blog.zupko.info/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.zupko.info</link>
	<description>Andy Zupko - Flash Experimentation, tutorials, and portfolio.</description>
	<lastBuildDate>Tue, 08 Dec 2009 15:07:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Unity Game Development Essentials</title>
		<link>http://blog.zupko.info/?p=321</link>
		<comments>http://blog.zupko.info/?p=321#comments</comments>
		<pubDate>Tue, 08 Dec 2009 15:06:43 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[review]]></category>
		<category><![CDATA[unity3d]]></category>

		<guid isPermaLink="false">http://blog.zupko.info/?p=321</guid>
		<description><![CDATA[
I was asked if I would give a book a look over &#8211; and given the topic, I couldn&#8217;t refuse.  Unity Game Development Essentials, by Will Goldstone was released by Packt Publishing &#8211; and can be found just about anywhere.  It has a cover price of $49.99 -  you can get a slight deal if [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-324" title="2009-11-22_0803" src="http://blog.zupko.info/wp-content/uploads/2009/11/2009-11-22_0803.png" alt="2009-11-22_0803" width="459" height="205" /></p>
<p>I was asked if I would give a book a look over &#8211; and given the topic, I couldn&#8217;t refuse.  Unity Game Development Essentials, by <a href="http://www.willgoldstone.com/">Will Goldstone</a> was released by Packt Publishing &#8211; and can be found just about anywhere.  It has a cover price of $49.99 -  you can get a slight deal if you grab it from <a href="http://www.packtpub.com/unity-game-development-essentials?utm_source=blog.zupko.info&amp;utm_medium=bookrev&amp;utm_content=blog&amp;utm_campaign=mdb_001351" target="_blank">here</a>, but I would check amazon for pricing as they often drop quickly there.</p>
<h3>Overview</h3>
<p>The book is geared for those with essentially no Unity3D experience &#8211; but might be useful to some who are starting out and would like to learn a little bit more about some of the tools that are available.  Don&#8217;t worry if you have no 3D experience, the book will walk you through the very basics &#8211; and honestly, not much programming experience is needed, as even the most basic concepts are covered in sections that use scripting &#8211; a good choice as many designer/developers find interest in such a user friendly product as Unity3D.  Obviously, to make the most of the engine, you will want to beef up on those skills.</p>
<p>Unity Game Development Essentials (UGDE) covers a fairly broad number of topics, starting with basic 3D concepts and the Unity Editor.  It moves into topics such as terrain, basic physics, and interacting with 3D elements in your world.  Next, particles, audio, and GUI are covered, giving a pretty broad brush stroke of what is available in Unity3D.  Each set of topics is divided into a small demo scenes, which can also be downloaded via a link found in the front of the book, and can be useful for following along with.  You will quickly learn how components are used in Unity, and how you can script basic scenarios, which could be useful in the context of a larger game.</p>
<p>The book itself is nicely organized, and will look good on your bookshelf (for those that care about that kind of thing).  It has a plethora of pictures and included (via download) project files that help you get on your way.  Each section is dedicated to a specific topic, so it is easy to jump around to something that more specifically interests you, say, if you already know how to use an FPSWalker.  It is a short book, as it only touches the basics of most of the features &#8211; coming in at about 280 pages (with relatively large font) &#8211; but I wouldn&#8217;t consider that a deterrent as the content is sound.</p>
<h3>Pros</h3>
<p>UGDE is a great book for those who are picking up Unity3D for the first time or coming from more of a design background.  It provides clear, concise explanations of many of the topics you probably want to know when developing your own game.  It walks you through the editor nicely, showing how the different panels and controls are used. Unity can be a bit of a tricky paradigm to figure out, especially if you come from a more OO world and aren&#8217;t use to the scripting nature of the engine.  UGDE provides some clever projects for you to develop, however, and by the end of the book you should have a pretty good understanding of what you can do with Unity3D.  My personal favorite chapter is the chapter dealing with interaction in your world.  UGDE shows two approaches to opening doors with triggers/colliders, as well as an introduction into some basic animation.  Ray colliders, for bullets, are covered, and even some animation control is sprinkled in.  But there are some other fun worlds, where you can light your campfire, and throw coconuts at targets.</p>
<h3>Cons</h3>
<p>The only real shortcoming of the book is that I wish there was more! Unity3D is a very expansive engine, so while it is impossible to cover everything, there are a few things I wish were talked about a bit more.  Shaders, for instance, are not discussed in any shape or form, despite being a very common 3D game element.  A chapter on simple shader development (or even the included shaders), and a look at how they are used in Unity would be a very nice addition.  Another area I felt could have used more pages was performance.  Performance is a huge issue with game development, and there are many tips and tricks that would be nice for someone getting into Unity to know about. It would also have been nice if there was at least a small section dedicated to iPhone specific projects, and the asset server &#8211; but those might be more niche than was intended for this printing.</p>
<h3>Overall</h3>
<p>Despite not going into as much depth as I might like, if you are brand new to Unity3D, or 3d game programming in general &#8211; I would highly recommend this book.  With a nice broad range of topics and a very easy-to-understand flow, I think it could really help someone starting out.  If you have been using Unity for a while, and are hoping for some nice gems to help with your development, this probably isn&#8217;t the book for you.  That said, I feel Will did a great job for artists and designers &#8211; who are the real target audience.</p>
<p>I haven&#8217;t covered hardly anything about Unity on my blog &#8211; but plan on it pretty soon &#8211; as it is something I have been working VERY extensively with lately.  If you are interested in learning more &#8211; I would seriously consider picking up this book, then hopefully I can start picking up where it leaves off.</p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zupko.info/?feed=rss2&amp;p=321</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Star Wars: Trench Run Released!</title>
		<link>http://blog.zupko.info/?p=317</link>
		<comments>http://blog.zupko.info/?p=317#comments</comments>
		<pubDate>Tue, 17 Nov 2009 03:01:27 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.zupko.info/?p=317</guid>
		<description><![CDATA[
Infrared5 has released its biggest game to date!  Hitting the AppStore today was Star Wars: Trench Run!  If you haven&#8217;t heard about it, it is our newest release, put out by THQ, which sits you behind the wheel (?) of an XWing fighter as you make your run on the Death Star trench.
The game rocks, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-318" title="trenchrun" src="http://blog.zupko.info/wp-content/uploads/2009/11/trenchrun.jpg" alt="trenchrun" width="500" height="260" /></p>
<p>Infrared5 has released its biggest game to date!  Hitting the AppStore today was <a href="http://itunes.apple.com/us/app/star-wars-trench-run/id335685707?mt=8" target="_blank">Star Wars: Trench Run</a>!  If you haven&#8217;t heard about it, it is our newest release, put out by THQ, which sits you behind the wheel (?) of an XWing fighter as you make your run on the Death Star trench.</p>
<p>The game rocks, and I&#8217;m not just saying that because we made it.  Imagine this: 3D flying action, controlled by tilt.  Dogfighting over the death star surface with Yavin 4 coming into sight.  For the whiley TIEs, you can slow down time with the force, giving you precise aiming to blow him out of space.  Next, imagine heading to the trench, dodging cannon fire and catwalks, evading Darth, and eventually, taking your shot at the exhause port.</p>
<p>Phew.</p>
<p>To top it all off, there is an arcade mode which lets you dogfight or dodge obstacles in progressively harder levels &#8211; throw in a leaderboard and the fun never stops.</p>
<p>Okay, thats enough of a plug from me.  Just go and get the game.  It is fully licensed, so you get to experience all of the sights and sounds of the TRUE Stars Wars universe.</p>
<p>Get it <a href="http://itunes.apple.com/us/app/star-wars-trench-run/id335685707?mt=8" target="_blank">HERE!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zupko.info/?feed=rss2&amp;p=317</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Papervision 3.0 &#8211; GIT it now!</title>
		<link>http://blog.zupko.info/?p=312</link>
		<comments>http://blog.zupko.info/?p=312#comments</comments>
		<pubDate>Wed, 14 Oct 2009 18:47:43 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Flash 10]]></category>
		<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.zupko.info/?p=312</guid>
		<description><![CDATA[
If you haven&#8217;t read the post over at the Papervision3D blog, you should head over and read it.  We are really cranking on Papervision 3.0 &#8211; the new version for Flash Player 10.  I think we have a great start, and best of all, it is on github  so you can watch/contribute to the process!  [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-314" title="gitpapervision" src="http://blog.zupko.info/wp-content/uploads/2009/10/gitpapervision.jpg" alt="gitpapervision" width="500" height="200" /></p>
<p>If you haven&#8217;t read the post over at the <a href="http://blog.papervision3d.org/" target="_blank">Papervision3D blog</a>, you should head over and read it.  We are really cranking on Papervision 3.0 &#8211; the new version for Flash Player 10.  I think we have a great start, and best of all, it is on github  so you can watch/contribute to the process!  Head over to <a href="http://github.com/Papervision3D/Papervision3D" target="_blank">http://github.com/Papervision3D/Papervision3D</a> where you can download the project in its current state, or git it so you can start participating.</p>
<p>This is my first time using git, and I must say that it has been very challenging to get started in.  Thinking from a SVN standpoint was a big roadblock for me in truly understanding how (g)it works.  Now that I am starting to really grasp how it works, as well as the commands to make it happen, I must say that I really like GIT!  Managing code, especially between multiple branches is incredibly easy to do.</p>
<p>Anyways &#8211; enough about git &#8211; hopefully my blog will start to generate a few more posts now that the engine is picking up steam &#8211; but don&#8217;t hold me too it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zupko.info/?feed=rss2&amp;p=312</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The Real Reason John Grden Hates Ewoks</title>
		<link>http://blog.zupko.info/?p=309</link>
		<comments>http://blog.zupko.info/?p=309#comments</comments>
		<pubDate>Mon, 24 Aug 2009 18:30:12 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.zupko.info/?p=309</guid>
		<description><![CDATA[
Just in case you were wondering&#8230;
]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-310" title="grdenwok" src="http://blog.zupko.info/wp-content/uploads/2009/08/ewok.jpg" alt="grdenwok" width="467" height="680" /></p>
<p>Just in case you were wondering&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zupko.info/?feed=rss2&amp;p=309</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Hunt For Gollum Released!</title>
		<link>http://blog.zupko.info/?p=304</link>
		<comments>http://blog.zupko.info/?p=304#comments</comments>
		<pubDate>Tue, 05 May 2009 15:48:33 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.zupko.info/?p=304</guid>
		<description><![CDATA[
One film to rule them all!
Not really &#8211; but it is pretty cool.  The Hunt For Gollum was released 2 days ago &#8211; it is a 40 minute film produced entirely by fans of the Lord of the Rings (who didn&#8217;t want to wait for the Hobbit release).  I&#8217;m not a huge fan of the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-306" title="huntgollum" src="http://blog.zupko.info/wp-content/uploads/2009/05/huntgollum.jpg" alt="huntgollum" width="501" height="220" /></p>
<p>One film to rule them all!</p>
<p>Not really &#8211; but it is pretty cool.  The Hunt For Gollum was released 2 days ago &#8211; it is a 40 minute film produced entirely by fans of the Lord of the Rings (who didn&#8217;t want to wait for the Hobbit release).  I&#8217;m not a huge fan of the 3 movies that are already out &#8211; about 22 hours into the saga I was about ready to end my life (especially after the 32 fade outs at the end of the third).  BUT, I thought this was cool given that the entire thing was done for under £3000.</p>
<p>The story follows Aragon&#8217;s creepy look-a-like as he hunts for Gollum who knows the location of the ring. It has pretty cheesy dialog / acting / audio &#8211; but they did a decent job on alot of the CG and make up. The characters are eerily reminisent of the actual characters in the movie &#8211; but all have a somewhat &#8220;herion addicted&#8221; look to them.</p>
<p>Anyways &#8211; worth a looksie if you are a fan of the trilogy.</p>
<p><a href="http://thehuntforgollum.s3.amazonaws.com/index.html" target="_blank">Check it out here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zupko.info/?feed=rss2&amp;p=304</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Go to Flash on Tap &#8211; FOR FREE!</title>
		<link>http://blog.zupko.info/?p=299</link>
		<comments>http://blog.zupko.info/?p=299#comments</comments>
		<pubDate>Sat, 02 May 2009 16:04:46 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[training]]></category>

		<guid isPermaLink="false">http://blog.zupko.info/?p=299</guid>
		<description><![CDATA[
No, I&#8217;m not kidding!  Tickets have been donated by an anonymous benefactor for those who have recently lost their job.  If you go and sign up know, you can get your ticket to Flash on Tap absolutely free.  You can read more about this awesome offer here.  There are a limited number of tickets, so [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flashontap.com/newsletter/20090501/index.htm" target="_blank"><img class="alignnone size-full wp-image-300" title="freeticket" src="http://blog.zupko.info/wp-content/uploads/2009/05/freeticket.png" alt="freeticket" width="500" height="265" /></a></p>
<p>No, I&#8217;m not kidding!  Tickets have been donated by an anonymous benefactor for those who have recently lost their job.  If you go and sign up know, you can get your ticket to Flash on Tap absolutely free.  You can read more about this awesome offer <a href="http://www.flashontap.com/newsletter/20090501/index.htm" target="_blank">here</a>.  There are a limited number of tickets, so be sure to go sign up now if you are interested! It is a great way to network and make some connections and skills that will help you out in the future.</p>
<p>Also, if you are still on the fence about attending Flash on Tap &#8211; you really don&#8217;t want to miss this one!  Between the awesome workshops, comradory, and presentations, PLUS an awesome venue, this is a must-attend event.  John and I are finishing up our workshop on Papervision3D &#8211; which will be covering everything from the bare basics to alot of the tips and tricks even seasoned users of the engine don&#8217;t know about &#8211; layers, shaders, tricks to avoid doing math, and more! There are some other great workshops on red5, animation, and even getting into iphone development.  Check them all out<a href="http://www.flashontap.com" target="_blank"> here</a>!</p>
<p>Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zupko.info/?feed=rss2&amp;p=299</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flash On Tap &#8211; May 28th-30th</title>
		<link>http://blog.zupko.info/?p=294</link>
		<comments>http://blog.zupko.info/?p=294#comments</comments>
		<pubDate>Mon, 13 Apr 2009 12:51:40 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.zupko.info/?p=294</guid>
		<description><![CDATA[
Flash on Tap is approaching!  If you haven&#8217;t signed up yet &#8211; head on over to http://www.flashontap.com and register now for great pricing!  If you aren&#8217;t familier with Flash on Tap &#8211; its a conference being held in Boston that is a combination of a beer and Flash.  If you are interested in taking some [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-153" title="2008-08-09_1610.png" src="http://blog.zupko.info/wp-content/uploads/2008/08/2008-08-09_1610.png" alt="2008-08-09_1610.png" width="500" height="185" /></p>
<p>Flash on Tap is approaching!  If you haven&#8217;t signed up yet &#8211; head on over to <a href="http://www.flashontap.com" target="_blank">http://www.flashontap.com</a> and register now for great pricing!  If you aren&#8217;t familier with Flash on Tap &#8211; its a conference being held in Boston that is a combination of a beer and Flash.  If you are interested in taking some workshops &#8211; check out the 1st day of the conference &#8211; featuring a good choice of all day workshops that should be very informative, and mostly a lot of fun.  I am doing a conference with John Grden that day on the basics of Papervision3D.  We will be covering everything from the basics of the coordinate system to increasing your FPS with layers.  If you have ever wanted to get a good ground-up walk-through &#8211; this would be the time to get it!</p>
<p>There are going to be some awesome speakers &#8211; great company &#8211; beer if you like it -  and me!  I&#8217;ll also be presenting on Papervision3D &#8211; though I haven&#8217;t narrowed down my exact topic &#8211; I&#8217;m thinking something along the lines of extending Papervision &#8211; showing the basics of some of the cool things that have been done with the Papervision engine, including JigLib and Flar &#8211; along with some cool things you can do with the built in classes.  If anyone has a better class idea &#8211; or if there is somethings specific you would really like me to cover &#8211; let me know!</p>
<p>Anyways &#8211; sign up now &#8211; it is going to be a lot of fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zupko.info/?feed=rss2&amp;p=294</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TextArea Images in AIR&#8230;</title>
		<link>http://blog.zupko.info/?p=288</link>
		<comments>http://blog.zupko.info/?p=288#comments</comments>
		<pubDate>Fri, 10 Apr 2009 02:38:52 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[bugs]]></category>

		<guid isPermaLink="false">http://blog.zupko.info/?p=288</guid>
		<description><![CDATA[
Haven&#8217;t seen them?  Apparently its because they don&#8217;t exist.  According to this bug report it was a known issue but not corrected before the last version of AIR was released.  I spent a good amount of time wondering what I was doing wrong before a friend did a search in the bugs list for me [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-289" title="bugs" src="http://blog.zupko.info/wp-content/uploads/2009/04/bugs" alt="bugs" width="500" height="200" /></p>
<p>Haven&#8217;t seen them?  Apparently its because they don&#8217;t exist.  According to <a href="http://bugs.adobe.com/jira/browse/SDK-14238" target="_blank">this bug report</a> it was a known issue but not corrected before the last version of AIR was released.  I spent a good amount of time wondering what I was doing wrong before a friend did a search in the bugs list for me &#8211; and voila!</p>
<p>So, my first question: does anyone know a work-around for this issue?  The comments recommend using the HTML component, but unfortunately I need a lot of the interactivity that the TextArea offers that the HTML component doesn&#8217;t have.  If anyone has an idea let me know.</p>
<p>If anyone of you aren&#8217;t sure where to find bugs for the Flash player, you can find them at <a href="http://bugs.adobe.com" target="_blank">bugs.adobe.com.</a> I use to never check the bugs list, as most of the problems are ran into when I was just getting into flash was user error &#8211; but now it seems that I probably need to spend more time at the bugs list before wasting hours of time late at night trying to figure out why my img tags disappeared.</p>
<p>Anyways &#8211; if anyone has an idea &#8211; shoot me an email or a comment!  I&#8217;ll be your friend!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zupko.info/?feed=rss2&amp;p=288</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JigLib &#8211; Bust a Cap In Papervision3D</title>
		<link>http://blog.zupko.info/?p=273</link>
		<comments>http://blog.zupko.info/?p=273#comments</comments>
		<pubDate>Thu, 05 Mar 2009 16:25:04 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[papervision]]></category>

		<guid isPermaLink="false">http://blog.zupko.info/?p=273</guid>
		<description><![CDATA[
I made my first JigLib Demo!  Check it out.
If you don't know what JigLib is yet, you are really missing out.  Its a great project I'm proud to be the on the team of.  It is a 3D physics engine (currently only for Papervision3D, but has been ported to Sandy/Away).  It is a port from [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lab.zupko.info/glock"><img class="alignnone size-full wp-image-274" title="glockshot2" src="http://blog.zupko.info/wp-content/uploads/2009/02/glockshot2.png" alt="glockshot2" width="500" height="213" /></a></p>
<p>I made my first JigLib Demo!  <a href="http://lab.zupko.info/glock" target="_blank">Check it out</a>.</p>
<p>If you don't know what JigLib is yet, you are really missing out.  Its a great project I'm proud to be the on the team of.  It is a 3D physics engine (currently only for Papervision3D, but has been ported to Sandy/Away).  It is a port from the JigLib engine done in C.  For more information on the project, check out the <a href="http://www.jiglibflash.com/blog/" target="_blank">blog</a>.</p>
<p>I don't really want to give a bottoms up rundown on how jiglib works, so I'm just going to point out a few things that will help you pull off effects like you see in this demo - both from the jiglib point of view, but also from a general pv3d and programming angle.</p>
<h2>The Environment</h2>
<p>This environment is actually very simple.  I have a bitmap for the floor, a lamp model, and a bitmap for the cubes.  I dynamically tint the cube materials to give it a little more depth and variety.  One thing you will notice is that each cube, and each side of each cube, gets its own material.  If you are wondering why, I did this to allow for the bullet holes to be drawn directly onto the material.  I use a movie material so that it is easy to just add a bitmap into with a specific blend mode, and then forget it.</p>
<p>The environment for JigLib is very similar.  Each cube is simply a "skin" for a class that represents a cube in JigLib.  This class is called "JBox".  You can think of a JBox as simply the "form" of a cube - it has position and rotation, which are transfered to the object that it is skinning.  This it the general way that JigLib works.  There are unique JigLib objects which use DisplayObject3D's in Papervision as a skin.  All transforms done to the JigLib physics object is then reflected on the DisplayObject3D.  JigLib has physics objects for Planes, Cubes (Box) and Spheres.  It also includes logic to generate a car with wheels, using a special wheel class and an extension of the JBox class.</p>
<p>So, each cube is controlled by a JBox - and the floor is a JPlane for them to bounce on.  There were some hit detection problems I was having with the plane, so I also added a JCube underneath the plane to give extra "floor" for the objects to run into.  This is a hack fix, but it seems to help.  Something else you can play with to help collision is the timing used by the physics engine.   A lower speed will mean that things will move slower, and detect more collisions more accurately.</p>
<h2>The Gun Shot</h2>
<p>The gun shot is made up of a couple different parts.  The gun itself actually "shoots" where it is looking - which is always 2000 in front of the barrel.  The only time this is changed is when a hit is detected on a cube.  When the mouse clicks on a cube, the target is changed to the exact coordinates of the hit.</p>
<h3>The Hit</h3>
<p>The actual hit is determined by the mouse click.  Take a look at the following code:</p>
<div class="igBar"><span id="lactionscript-3"><a href="#" onclick="javascript:showPlainTxt('actionscript-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-3">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> hitPoint : Number3D = <span style="color: #000000; font-weight: bold;">new</span> Number3D<span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">renderHitData</span>.<span style="color: #006600;">x</span>, event.<span style="color: #006600;">renderHitData</span>.<span style="color: #006600;">y</span>, event.<span style="color: #006600;">renderHitData</span>.<span style="color: #006600;">z</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> force:Number3D = <span style="color: #000000; font-weight: bold;">new</span> Number3D<span style="color: #66cc66;">&#40;</span>hitPoint.<span style="color: #006600;">x</span>-<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">x</span>, hitPoint.<span style="color: #006600;">y</span>-<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">y</span>, hitPoint.<span style="color: #006600;">z</span>-<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">z</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">force.<span style="color: #006600;">normalize</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">force.<span style="color: #006600;">multiplyEq</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">6280</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> rb:RigidBody = skins<span style="color: #66cc66;">&#91;</span>event.<span style="color: #006600;">displayObject3D</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">rb.<span style="color: #006600;">AddWorldForce</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> JNumber3D<span style="color: #66cc66;">&#40;</span>force.<span style="color: #006600;">x</span>, force.<span style="color: #006600;">y</span>, force.<span style="color: #006600;">z</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> JNumber3D<span style="color: #66cc66;">&#40;</span>hitPoint.<span style="color: #006600;">x</span>, hitPoint.<span style="color: #006600;">y</span>, hitPoint.<span style="color: #006600;">z</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>hitPoint records where the mouse was clicked in world space.  Remember, this is only called when a cube is clicked.  We then get the difference between that point and the camera, to get our "force" vector.  To make it a constant strength, we simply normalize it (make it a length of 1), then multiply it by the force we want.  We get our RigidBody from the dictionary I store the references in.  Then, we use the function "AddWorldForce" - which takes two JNumber3Ds - the force vector, and the world hit point.  This function will add the force to the object from world space - which saves us having to convert things into local coordinates.</p>
<h3>The Bullet Trail</h3>
<p>The bullet trail is a seperate class called LineOut.  I called it LineOut since it fades itself out every frame.  Once its invisible, it removes itself from the scene.  To get the start and end points of the Line between the gun, I pass in two objects - the target that is positioned at the hit point, and the the muzzle flash that is positioned over the gun barrel.  Before we can use the muzzle flash position, however, we need to update its world coordinates:</p>
<h5>startPoint.world.calculateMultiply((startPoint.parent as DisplayObject3D).world, startPoint.transform);</h5>
<p>Once the world matrix is updated with the current transform, we can use the world matrix to define the start point of the line.  I use a segmented line because it looks better - but feel free to play with how many vertices are actually used.</p>
<h3>The Bullet Hole</h3>
<p>Since we used a seperate bitmap for each side of the cubes, we can alter them individually.  This has more memory overhead, but I think it more than makes up for it by having bullet holes.  The bullet hole position is determined, again, by the renderHitData that is passed when a cube is clicked.  The U and V properties of the renderHitData tell us the "x" and "y" coordinates of the click on the material.  Once we have that, we can simply add a bullet hole bitmap to our movie, and position it correctly:</p>
<div class="igBar"><span id="lactionscript-4"><a href="#" onclick="javascript:showPlainTxt('actionscript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-4">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> mat:MovieMaterial = event.<span style="color: #006600;">renderHitData</span>.<span style="color: #006600;">material</span> as MovieMaterial;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> hole : Bitmap = Sprite<span style="color: #66cc66;">&#40;</span>mat.<span style="color: #006600;">movie</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> bulletAsset<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> as Bitmap;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">hole.<span style="color: #006600;">blendMode</span> = <span style="color: #ff0000;">"overlay"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">hole.<span style="color: #006600;">x</span> = event.<span style="color: #006600;">renderHitData</span>.<span style="color: #006600;">u</span>-hole.<span style="color: #0066CC;">width</span>*<span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">5</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">hole.<span style="color: #006600;">y</span> = event.<span style="color: #006600;">renderHitData</span>.<span style="color: #006600;">v</span>-hole.<span style="color: #0066CC;">height</span>*<span style="color: #cc66cc;color:#800000;">0</span>.<span style="color: #cc66cc;color:#800000;">5</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mat.<span style="color: #006600;">drawBitmap</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>We take half the width and height to make sure that the bullet hole is properly centered on the hit point.  One other thing to keep in mind is to define the clipping rect for the movie material when you initially make it.  If you don't, your texture will become skewed if bullet holes go off the edge of the material, changing the size of the texture.</p>
<p>Those are the main parts of the demo - hopefully some things are helpful.  I was hoping to show some fun uses of JigLib - and hopefully spawn some cool ideas in the process.</p>
<p><a href="http://lab.zupko.info/glock/Glock.zip" target="_blank">Here is the Source Code</a></p>
<p>and</p>
<p><a href="http://lab.zupko.info/glock" target="_blank">A Link to the Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zupko.info/?feed=rss2&amp;p=273</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Tails, You Win &#8211; 3D Trails In Papervision</title>
		<link>http://blog.zupko.info/?p=264</link>
		<comments>http://blog.zupko.info/?p=264#comments</comments>
		<pubDate>Wed, 18 Feb 2009 04:10:36 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[papervision]]></category>

		<guid isPermaLink="false">http://blog.zupko.info/?p=264</guid>
		<description><![CDATA[
I'm not really sure where the inspiration came from, but I decided to take a stab at doing Motion Trails with Pv3D.  Instead, I ended up with something more like a tail - but left the class name MotionTrail... Anyways - there isn't a whole lot to say on the technique I used here - [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lab.zupko.info/trails" target="_blank"><img class="alignnone size-full wp-image-265" title="2009-02-16_2218" src="http://blog.zupko.info/wp-content/uploads/2009/02/2009-02-16_2218.png" alt="2009-02-16_2218" width="500" height="251" /></a></p>
<p>I'm not really sure where the inspiration came from, but I decided to take a stab at doing Motion Trails with Pv3D.  Instead, I ended up with something more like a tail - but left the class name MotionTrail... Anyways - there isn't a whole lot to say on the technique I used here - but I will give a general overview just to save you looking at code.  <a href="http://lab.zupko.info/trails" target="_blank">See the Demo</a>.</p>
<p>The tail is defined by Number3D objects which "chase" each other, with the head node being pinned to the target you are chasing.  Each Number3D, which I've extended into a Trail3D class (its internal - just look in the MotionTrail.as file) - springs after the node ahead of it.  You can control this "springyness" by adjusting the minEase property of the MotionTrail.  The minEase refers to the ease amount of the very last node on the tail - which increases each node up to the head, which has an ease of 1.  So, the lower you set minEase, the slinkier the tail will end up looking.  You can control how many nodes are in the tail by adjusting the "iterations" parameter of the MotionTail class.  You need at least 2.</p>
<p>The tail is actually a triangle strip, which progressively gets smaller the closer to the end it gets.  This 1) lets you use any material you want, and 2)easily adjust the look and feel of the tail all you want. Feel free to override it to affect the width with speed, distance, or any other cool variables you want.  It looked good just tapering so I left it that way.   The triangle strips vertices are adjusted to their corresponding TrailNode, so they always face the camera.  This keeps the tail visible from any direction.  Again, you could change this if you wanted it to be a more obvious flat tail.  My initial idea was to use the delta properties of the adjacent nodes to determine the nodes up vector (find the cross product between the dx/dy/dz values of the nodes on either side of the current node) - but again - I liked how this looks so I left it.</p>
<p>The demo itself just makes use of some bezier curves to keep things moving smoothly.  You will notice the nodes are flocking - but really it is just setting the control point and end point of each node within a certain range - which changes positions when the first object arrives.  You can press "F" to toggle it so that each node has its own unique path.</p>
<p>Anyways - <a href="http://lab.zupko.info/trails/trails.zip" target="_blank">here is the code</a>,</p>
<p>and another look <a href="http://lab.zupko.info/trails" target="_blank">at the demo</a></p>
<p>enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.zupko.info/?feed=rss2&amp;p=264</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>
