<?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>sevenson.com.au &#187; Papervision 3D</title>
	<atom:link href="http://www.sevenson.com.au/tag/papervision-3d/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sevenson.com.au</link>
	<description>The online presence of Andrew Sevenson</description>
	<lastBuildDate>Tue, 11 Oct 2011 10:53:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Sciences at Melbourne Website</title>
		<link>http://www.sevenson.com.au/showcase/sciences-at-melbourne-website/</link>
		<comments>http://www.sevenson.com.au/showcase/sciences-at-melbourne-website/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 11:30:06 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[Online Showcase]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Papervision 3D]]></category>
		<category><![CDATA[Visual Jazz]]></category>

		<guid isPermaLink="false">http://www.sevenson.com.au/?p=379</guid>
		<description><![CDATA[Did you ever get the feeling that you were being tested? That&#8217;s what happened to me with this site. The designers I work with at Visual Jazz really like to push us developers some times. When I first saw the designs for it I remember saying to myself &#8216;Gosh darn! How is one supposed to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/icon1.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/icon1.jpg" alt="" title="Melbourn University Sciences Icon" width="250" height="190" class="alignright size-full wp-image-486" /></a>Did you ever get the feeling that you were being tested?  That&#8217;s what happened to me with this site.  The designers I work with at <a href="http://www.visualjazz.com.au" target="_blank">Visual Jazz</a> really like to push us developers some times.</p>
<p>When I first saw the designs for it I remember saying to myself &#8216;Gosh darn! How is one supposed to go about doing that??&#8217; (I may have used some more colourful language but you get the jist)   I had never done 3D before, and that was just the beginning.  There was depth of field, keyed out video, and a pile of information to be displayed.</p>
<p>Luckily, it all came together in the end &#8211; you can read about how in this post.  </p>
<p><span id="more-379"></span></p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/home1.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/home1-300x191.jpg" alt="" title="Melbourne University Home Screen" width="300" height="191" class="alignleft size-medium wp-image-485" /></a>The main idea behind the site was for a big 3D column with 3 spiralling streams of video screens wrapped around it.  The user could spin and pan the column around to see the different screens.  When they click on one, it would come to the foreground where a video would then play.</p>
<p>The first place I started was to learn about PaperVision 3D.  Luckily for me, there is a huge number of posts and tutorials to get me started.  Yay for the internet!</p>
<p>Once I had the customary 3D primitives floating around on screen, I started looking into the problem of faking depth of field.  The idea I had was to create a series of blurred textures for each object, then swap them out based on their distance from the camera.  If you want a bit more detail on this, check out an post I wrote on it <a href="http://www.sevenson.com.au/actionscript/depth-of-field/">here</a>.</p>
<p>There were of course some other tricky items involved &#8211; because the screens have some depth to them, simply blurring the textures did not look right.  I had to make it so that when the screens got about halfway back, they were swapped over with a basic plane.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/student.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/student-300x191.jpg" alt="" title="Melbourne University Student Page" width="300" height="191" class="alignright size-medium wp-image-488" /></a><a href="http://www.sevenson.com.au/content/uploads/2010/02/studentDetail.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/studentDetail-300x191.jpg" alt="" title="Melbourne University Student Detail Page" width="300" height="191" class="alignright size-medium wp-image-489" /></a>The next 3D problem was the curved lines.  We could have just had some curved lines modelled up in max, but because we wanted the lines to blur, they had to be done in a similar way to the other blurry objects.  I ended up coming up with a bit of code that would generate the curved lines from a series of small straight lines, basically aligning them from end to end.  This allowed me to blur individual segments, which wasn&#8217;t a perfect result, but worked pretty damn well.</p>
<p>I can&#8217;t even remember the exact method &#8211; I just know that it included a fair bit of trigonometry and experimentation. </p>
<p>The last 3D part was getting the videos to line up with the 3D screens when they were selected.  It took a bit of playing around, but after a bit of googling and tweaking some figures I finally got it all lining up nicely.  There is bit of a formula to getting 3D graphics to line up, but once you know it, it just works.</p>
<p>Oh, as for the big green curved shapes, they were pretty simple.   They were simplymodelled up by the 3D guys and loaded into the scene via a Collada (DAE) file.  Apart from some minor texture path issues, they were probably the easiest parts of the site.</p>
<p>The videos themselves were pretty cool.  Each of the students represented on a screen was filmed on a keyed background, walking out from behind the panel.  They would then introduce themselves before returning back to behind the panel.  It was a pretty simple trick, but proved to be quite effective.  There was a little bit of trickery involved getting the walking in and out to look right, but we got there in the end.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/parents.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/parents-300x191.jpg" alt="Melbourne University Sciences - Info for Parents" title="Melbourne University Sciences - Info for Parents" width="300" height="191" class="alignleft size-medium wp-image-487" /></a>After all of that, the only remaining content was a series of different informational pages.  These were pretty straightforward and were achieved by using a template system that was run off of XML based content.  This allowed us to easily add and edit content to the site without the need for an entire rebuild.</p>
<p>Overall it was a pretty cool project, so check it out if you get the chance &#8211; <a href="http://sciences.melbourne.edu/" target="_blank">Sciences at Melbourne</a>. You can also read about it on the <a href="http://www.visualjazz.com.au/#/portfolio/uni_melbourne_sciences/" target="_blank">Visual Jazz</a> site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/showcase/sciences-at-melbourne-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Liv Doll Microsite</title>
		<link>http://www.sevenson.com.au/showcase/liv-doll-microsite/</link>
		<comments>http://www.sevenson.com.au/showcase/liv-doll-microsite/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 11:26:29 +0000</pubDate>
		<dc:creator>Andrew Sevenson</dc:creator>
				<category><![CDATA[Online Showcase]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Augmented Reality]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Papervision 3D]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visual Jazz]]></category>

		<guid isPermaLink="false">http://www.sevenson.com.au/?p=387</guid>
		<description><![CDATA[Working at Visual Jazz does expose me to some interesting scenarios/ I mean, playing with dolls for a couple of weeks isn&#8217;t my usual idea of a good time, but this funky little microsite had some pretty cool features that had my brain ticking over the whole time. Some interesting 3D modelling and animation coupled [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/icon3.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/icon3.jpg" alt="Liv Doll Microsite Icon" title="Liv Doll Microsite Icon" width="250" height="190" class="alignright size-full wp-image-500" /></a>Working at <a href="http://www.visualjazz.com.au/" target="_blank">Visual Jazz</a> does expose me to some interesting scenarios/  I mean, playing with dolls for a couple of weeks isn&#8217;t my usual idea of a good time, but this funky little microsite had some pretty cool features that had my brain ticking over the whole time.</p>
<p>Some interesting 3D modelling and animation coupled with my first attempt augmented reality in flash made for some puzzling times.  Drench all that in a healthy dose of girly-ness and you get <a href="http://www.livinmyworld.com.au/" target="_blank">www.livinmyworld.com.au</a>.</p>
<p>Read on to find out more some of the more nerdy details <img src='http://www.sevenson.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-387"></span></p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/home2.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/home2-300x191.jpg" alt="Liv Doll Microsite" title="Liv Doll Microsite" width="300" height="191" class="alignleft size-medium wp-image-499" /></a>The idea behind the Liv doll site was to invite visitors to try out some of the different clothing accessories on a 3D version of a doll.  Once they have found a look that they are happy with they can use a webcam and augmented reality to take a photo of themselves posing with the doll.  This photo can then be saved, printed or sent on to their friends.</p>
<p>My job as the ActionScripter was to take all the designs, models and animations and make it all work.  Easy peasy&#8230; sort of.</p>
<p>The base of the site was pretty simple. It followed a basic page structure using on lots of flat colours, shading and bouncy transitions to help bring the site to life. Overall it was a very &#8216;happy&#8217; site and I had a lot of fun putting it together.</p>
<p><a href="http://www.sevenson.com.au/content/uploads/2010/02/dress.jpg"><img src="http://www.sevenson.com.au/content/uploads/2010/02/dress-300x191.jpg" alt="Liv Doll 3D Dress-up" title="Liv Doll 3D Dress-up" width="300" height="191" class="alignright size-medium wp-image-497" /></a>The tricky stuff started with the 3D.  Papervison was my weapon of choice. Mostly because I had used it before, but also because we hit some early snags with Away3D and I didn&#8217;t have time to try and resolve them.</p>
<p>Because we were allowing the user to change the hair, top and pants on the 3D model, each part had to be imported separately.  The 3D guy had loads of fun generating the different clothes, animating them, and then splitting them up for me.</p>
<p>These split up files meant that I needed to create a way to manage the loading of models and the related textures.  That was easy enough, but  part way through the process we noticed that some of the model combinations resulted in clipping.  This didn&#8217;t look very good and actually had an impact on the performance.</p>
<p>I discovered that if I applied an alpha channel to the offending model&#8217;s texture, the clipping went away and the performance improved (Sounds strange right?  Adding transparency made it run better?  Go figure). With this in mind I created a data management object which would load the required models and textures, then figure out what masking was required to make it all look good.</p>
<p>Sounds easy when I write it like that, but it actually got quite complex.  I basically had to write a matrix that would look at what clothes you were matching up, load the required textures, then merge the alpha channel with the textures before finally applying it to the model.</p>
<p>Next big thing was the animation of the models.  Not that playing the animation was hard, but keeping all the models in sync as they were swapped around was.  The animation controls in PaperVision weren&#8217;t the greatest for what I needed to do so I ended up using the <a href="http://code.google.com/p/daeanim/" target="_blank">DAE MC2</a> classes.  They allowed me to treat the animations a bit more like a MovieClip, so it was a lot easier to keep everything in sync.</p>
<p>The final big hurdle was the Augmented Reality (AR).  For this I used the awesome <a href="http://www.libspark.org/wiki/saqoosha/FLARToolKit/en" target="_blank">FLAR ToolKit</a> for this.  Unfortunately, a lot of the docs were in Japanese, so I ended up hunting down a tutorial/example over at <a href="http://www.mikkoh.com/blog/?p=182" target="_blank">Mikko Haapoja&#8217;s Blog</a>.  This got me up and running in no time.  </p>
<p>Out of the box it didn&#8217;t perform as well as I would have liked, so I spent a bit of time tweaking the code to make it run better.  Nothing too spectacular, just simple things like shrinking the size of the webcam image to reduce the number of calculations required and only calculating &#8216;every other&#8217; frame.</p>
<p>Another little tweak I did was to apply a basic &#8216;ease&#8217; to the model position.  This helped smooth out the little motions that the camera picked up and helped make AR feel much more responsive.</p>
<p>That&#8217;s about it.</p>
<p>Overall I am extremely happy with the site.  The designers and 3D modellers I work with at <a href="http://www.visualjazz.com.au/" target="_blank">Visual Jazz</a> did an awesome job of building the assets and despite the technical difficulties I mentioned above, it all came together well in the end.</p>
<p>If you haven&#8217;t checked it out already, go have a look at it <a href="http://www.livinmyworld.com.au/" target="_blank">here</a>.  You can also read a bit about it on the <a href="http://www.visualjazz.com.au/#/portfolio/livinmyworld" target="_blank">VJ Site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sevenson.com.au/showcase/liv-doll-microsite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

