<?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>Labs @ Jam3 - Toronto Web Development Reseach Blog &#187; HTML5</title>
	<atom:link href="http://labs.jam3.ca/category/html5/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.jam3.ca</link>
	<description></description>
	<lastBuildDate>Thu, 05 Jan 2012 18:53:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Paper.js: Vector meets Canvas</title>
		<link>http://labs.jam3.ca/2011/08/paper-js-vector-meets-canvas/</link>
		<comments>http://labs.jam3.ca/2011/08/paper-js-vector-meets-canvas/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 13:41:20 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[paper.js]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=947</guid>
		<description><![CDATA[
I know I&#8217;m not the first to delve into the world of Paper.js, but being such a new technology, i figured it was worth a look. Not to mention that you can do some pretty neat stuff with it on any canvas enabled browser.
See these quick examples:
cubes
lines
starfield

First off, if you don&#8217;t know about Paper.js, definitely [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/08/paperjs_5.jpg"><img src="http://labs.jam3.ca/wp-content/uploads/2011/08/paperjs_5.jpg" alt="" title="paperjs_5" width="537" height="296" class="alignnone size-full wp-image-1004" /></a><br />
I know I&#8217;m not the first to delve into the world of Paper.js, but being such a new technology, i figured it was worth a look. Not to mention that you can do some pretty neat stuff with it on any canvas enabled browser.</p>
<p>See these quick examples:<br />
<a href="http://labs.jam3.ca/paper/?id=0" target="_blank">cubes</a><br />
<a href="http://labs.jam3.ca/paper/?id=1" target="_blank">lines</a><br />
<a href="http://labs.jam3.ca/paper/?id=2" target="_blank">starfield</a></p>
<p><span id="more-947"></span></p>
<p>First off, if you don&#8217;t know about Paper.js, definitely <a href="http://paperjs.org/">check it out</a>, its a vector graphics framework built on top of Javascript and the HTML 5 Canvas element. It gives you the ability to easily draw some pretty neat things, and performance seems pretty great as well (usually runs about 60fps). It takes a bit getting used to, but its an interesting approach to the normal javascript development process. Here is the basic setup.</p>
<pre><code>
&lt;script src="js/paper.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="js/main.js" type="text/paperscript"&gt;&lt;/script&gt;
&lt;canvas id="draw" width="100%" height="100%" resize="true"&gt;&lt;/canvas&gt;
</code></pre>
<p>As you can see, first you include the Paper.js source file, then you include your code file with the type as text/paperscript. This will setup your basic events and also provide your script with the extra functionality and classes that Paper.js uses. You also pass the id of the canvas element you want to draw to with the canvas parameter. That&#8217;s pretty much all you need to get you started. Paper.js adds a lot of new classes to use for drawing and also hooks up your events for you so you can get right to the creative part. A complete api reference is available <a href="http://paperjs.org/reference/">here</a>. My template file usually starts off with some of the more common events, as seen below.</p>
<pre><code>
function onFrame(e) {
	e.time // Time in seconds since the app started
}
function onResize(e) {
	view.size // The current canvas size, in a Size object.
}
function onMouseMove(e) {
	e.point; // The current mouse position, in a Point object.
}
</code></pre>
<p>I won&#8217;t go into too much detail about the basic javascript code, but i will go over some of the basic drawing techniques I&#8217;ve used. Path is your basic drawing class, allowing you to draw lines and shapes similar to the flash graphics engine. To control the look of your Path you set fillColor and and strokeColor (they accept CSS values or the colour classes provided by Paper.js like RGBColor). Once a path has been created, it is in the display list unless you specifically call remove(). You can also add your paths to a Group which allows you to control them all with a single function call. I&#8217;ll go over how i drew the shapes in each example.</p>
<p><a href="http://labs.jam3.ca/paper/?id=1">Lines</a> / <a href="http://labs.jam3.ca/paper/js/lines.js">Source</a></p>
<p>Lines are one of the easiest things to draw in Paper.js. Simply create a Path, add points to the line by sending a Point object to the add() function. If you would like your line to be curved instead of jagged, simply call smooth() on the Path. To change the thickness and colour, simply set the strokeColor and strokeWidth properties. Note: the smooth() function must be called any time the points change.</p>
<pre><code>
path = new Path();
path.strokeWidth = Math.round(Math.random()*4)+2;
path.strokeColor = STROKE_COLOR;
for (var n=0; n&lt;POINTS; n++) {
	path.add(new Point(width/(POINTS-1)*n,start+i*SPACING));
}
</code></pre>
<p>The animation of this is a simple sin wave with a multiplier based off mouse position.</p>
<p><a href="http://labs.jam3.ca/paper/?id=2">Stars</a> / <a href="http://labs.jam3.ca/paper/js/stars.js">Source</a></p>
<p>Stars is also a simple application.</p>
<pre><code>
new Path.Circle(new Point(0,0),values.size);
initial.fillColor = 'white';

var symbol = new Symbol(initial);
for (var i=0; i&lt;values.stars; i++) {
	var item = symbol.place(Point.random()*view.size);
}
</code></pre>
<p>We create an initial circle using the Path.Circle function passing in the center point and the radius. This time, we create a Symbol out of the circle which basically turns our circle into a stamp. We call the function place() on the Symbol and pass in a Point object to create a copy of the item at that location. Since we do not keep track of each item in this project, we can simply loop through the children of the activeLayer which is a property of the project variable (available by default without having to declare it).</p>
<pre><code>
var layer = project.activeLayer;
for (var i = 0; i &lt; layer.children.length; i++) {
	layer.children[i].x += values.speed*item.data.scale;
}
</code></pre>
<p>The speed of the particles in this example is controlled by mouse position.</p>
<p><a href="http://labs.jam3.ca/paper/?id=0">Cubes</a> / <a href="http://labs.jam3.ca/paper/js/cubes.js">Source</a></p>
<p>The cube creating part of this example was taken from the Paper.js examples, but i&#8217;ll try to explain whats going on:</p>
<pre><code>Path.RegularPolygon(view.center, 6, 30);</code></pre>
<p>This function creates a 6 sided polygon that has a radius of 30, simple enough, but to create the 3d colouring effect, we have to parse each segment (each segment being a triangle for each side of the shape) into its own Path. To do this, we run through the segments array and clone() each segment into a path and colour them appropriately. This only needs to happen once, as we are then able to simply clone() the Cube that we have created and stored when we want to make another.</p>
<p>The animation of this is just a simple spring effect with a mouse based rotation applied to the container.</p>
<p>I hope these examples have given you a good primer to get started with Paper.js. Now that you have the basics, you are good to go, let your creativity fly. Paper.js allows you to easily create shapes, lines, and even work with loaded images. There is still a lot of unexplored terrain left for me to explore, but here are a few of the examples i came up with after taking a look through the examples posted on the Paper.js website. I&#8217;ve also provided the links to the source so you can see how its done.</p>
<p><a href="http://labs.jam3.ca/paper/">View Examples</a></p>
<p>You can check out the official examples <a href="http://paperjs.org/examples/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/08/paper-js-vector-meets-canvas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RadioHead WebGL</title>
		<link>http://labs.jam3.ca/2011/08/radiohead-webgl/</link>
		<comments>http://labs.jam3.ca/2011/08/radiohead-webgl/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 03:43:30 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Radiohead]]></category>
		<category><![CDATA[WebGL]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=892</guid>
		<description><![CDATA[
Seem&#8217;s like I&#8217;ve brought the House Of Cards dataset to almost every platform I work with. So it was only logical to use it with my first experiments with WebGL:


To see it in action click below (you must have a WebGL enabled browser):
House Of Cards WebGL
Click on the options on the right to change the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://labs.jam3.ca/wp-content/uploads/2011/07/radiohead.jpg" alt="" title="RadioHead" width="537" height="296" class="alignnone size-full wp-image-933" /></p>
<p>Seem&#8217;s like I&#8217;ve brought the House Of Cards dataset to almost every platform I work with. So it was only logical to use it with my first experiments with WebGL:<br />
<iframe src="http://player.vimeo.com/video/26014170?title=0&amp;byline=0&amp;portrait=0" width="580" height="326" frameborder="0"></iframe><br />
<span id="more-892"></span><br />
To see it in action click below (you must have a WebGL enabled browser):<br />
<a href="http://labs.jam3.ca/wp-content/uploads/2011/07/index.html" target="_blank">House Of Cards WebGL</a></p>
<p>Click on the options on the right to change the way the model looks.</p>
<p>The setting for rendering tris for edges will toggle what geometry will be rendering so if you unselect edges it will stop rendering the &#8220;lines&#8221; around the triangles.</p>
<p>The colour setting will change the way the model looks. By selecting <strong>&#8220;Use Model Colours&#8221;</strong> it will use the colour &#8220;intensity&#8221; values from the RadioHead dataset. If you select <strong>&#8220;Use Solid Colour&#8221;</strong> it will shade the entire model with one colour that is lit with a directional light. Selecting <strong>&#8220;Show Normals&#8221;</strong> will render the triangles based on the Normals of the vertices.</p>
<p>Under animation you can turn on and off the wave motion.</p>
<p>This was a fun small experiment but I learned a lot doing it. I&#8217;m not 100% sure the Normals were calculated correctly but it seems like it. Regardless&#8230; I like how it turned out. </p>
<p>I think Google liked it too since they decided to put it on Chrome Experiments:<br />
<a href="http://www.chromeexperiments.com/detail/radiohead-webgl/">http://www.chromeexperiments.com/detail/radiohead-webgl/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/08/radiohead-webgl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Björk Part2: Inner Workings</title>
		<link>http://labs.jam3.ca/2011/07/bjork-part2-inner-workings/</link>
		<comments>http://labs.jam3.ca/2011/07/bjork-part2-inner-workings/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 17:13:12 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=818</guid>
		<description><![CDATA[
When I look back on developing Björk I&#8217;m surprised by one thing&#8230; It wasn&#8217;t as painful as I thought it would be.
When I first saw the creative for the site I started thinking &#8220;How will we pull this off in HTML?&#8221;. As the previous post stated we took quite a few test routes before deciding [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://labs.jam3.ca/wp-content/uploads/2011/07/bjork2.jpg" alt="" title="Björk Part 2" width="537" height="296" class="alignnone size-full wp-image-910" /><br />
When I look back on developing Björk I&#8217;m surprised by one thing&#8230; It wasn&#8217;t as painful as I thought it would be.</p>
<p>When I first saw the creative for the site I started thinking &#8220;How will we pull this off in HTML?&#8221;. As the previous post stated we took quite a few test routes before deciding on doing everything using canvas. Once we had decided on the Canvas method I developed Jam3D.js quite quickly. I think the core of the engine was written in two days or so.</p>
<p>You might be asking why didn&#8217;t I just use another 3D engine that&#8217;s out there. Well&#8230; Generally with projects that have a tight timeline or are high profile I&#8217;m scared to use other peoples tools/code. Especially when it needs to be optimized as much as possible. It&#8217;s very hard to optimize someone else&#8217;s code vs your own. Sometimes to optimize code you have to know every nook and cranny of the code. That&#8217;s not to say I don&#8217;t EVER use other people&#8217;s libraries. (I do look forward to playing with <a href="https://github.com/mrdoob/three.js/" target="_blank">ThreeJS</a> though)</p>
<p>When I was writing Jam3D.js I knew we had to optimize as much as possible but still keep it flexible. To do this you have to keep things as simple as possible.<br />
<span id="more-818"></span><br />
If you look at Jam3D.js you&#8217;ll notice that its really just one array of 3D (x, y, z) points that is being transformed by a 3D transformation matrix and an array that represents those 3D points transformed into their 2D form (x, y). You can&#8217;t get more simple then that.<br />
<img src="http://labs.jam3.ca/wp-content/uploads/2011/07/mikko_bjork_Scene3D_cole.jpg" alt="" title="Björk Scene3D" width="537" height="296" class="alignnone size-full wp-image-910" /><br />
I kept these point arrays as one dimensional arrays of numbers because I wasn&#8217;t sure how intensive it would be to do two dimensional lookups on a Javascript array. At every point when developing something that&#8217;s processor intensive you have to think of these small details.</p>
<p>In order to keep our sanity we created four classes to help us modify and render Scene3D&#8217;s point array. These four classes being Vector3D, Line3D, Circle3D , and CurvePath3D.</p>
<p>Vector3D was the class that would never make an appearance on Björk&#8217;s stage, it would never be rendered, but it was used to create all the 3D objects and also used for some calculations in the site. Vector3D is sort of like a 3D point&#8230; It has properties such as x, y, z position but I also added in two properties x2D and y2D. x2D and y2D were getters that &#8220;reached&#8221; into Scene3D&#8217;s transformed 2d point array to grabed the &#8220;2d&#8221; version of a position. Actually the 3d positions also &#8220;grabbed/pushed&#8221; their values from the Scene3D array.</p>
<p><img src="http://labs.jam3.ca/wp-content/uploads/2011/07/mikko_bjork_Vector3D_cole.jpg" alt="" title="Björk Vector3D" width="537" height="296" class="alignnone size-full wp-image-912" /></p>
<p>This simplest shape that we rendered/drew to Canvas I would say was Circle3D. Circle3D really just had two properties one Vector3D and the radius of the circle. Because we were dealing with perfect &#8220;spheres&#8221; in this site we didn&#8217;t have to calculate anything else beside&#8217;s the location of a circle/spere. Actually I think because of this the Circles were the fastest item&#8217;s to render to screen. Really with just a minimal performance hit.</p>
<p><img src="http://labs.jam3.ca/wp-content/uploads/2011/07/mikko_bjork_Circle3D_cole.jpg" alt="" title="Björk Circle3D" width="537" height="296" class="alignnone size-full wp-image-914" /></p>
<p>Line3D you could guess was quite simple too. It really just contains a start and end position vector3d.</p>
<p><img src="http://labs.jam3.ca/wp-content/uploads/2011/07/mikko_bjork_Line3D_cole.jpg" alt="" title="Björk Line3D" width="537" height="296" class="alignnone size-full wp-image-911" /></p>
<p>Curve3D was the most complex 3D object we were rendering to screen and really was the only one I wasn&#8217;t super confident writing. Up until this point I had never written 3D curves. I was a little bit nervous because in actuality it&#8217;s not even often I write code to render 2d curves. HAH&#8230; But after a bit of experimentation I realized we could render Quadratic or Bezier curves in 3D.</p>
<p>Curves in computer graphics are defined by a starting point and end point and a point that &#8220;effects&#8221; how we will curve in-between those<br />
points. </p>
<p><img src="http://labs.jam3.ca/wp-content/uploads/2011/07/mikko_bjork_Quadratic_cole.jpg" alt="" title="Björk Quadratic Curve" width="537" height="296" class="alignnone size-full wp-image-918" /></p>
<p>Well to be honest the above is a Quadratic curve. A bezier curve has two control points or points that &#8220;effect&#8221; the curve.</p>
<p><img src="http://labs.jam3.ca/wp-content/uploads/2011/07/mikko_bjork_Bezier_cole.jpg" alt="" title="Björk Bezier" width="537" height="296" class="alignnone size-full wp-image-919" /></p>
<p>You might&#8217;ve noticed that I speak very vaguely about the control point effecting the curve and really because it&#8217;s actually very hard to distinctly say how it effects it. The equation for a Quadratic curve is quite simple but it&#8217;s hard to judge quickly what a curve will look like by just knowing the the start, end, and control point of a curve. (for you who&#8217;ve used Illustrator will know) And because of this reason I was very scared to start coding 3D curves. But it turns out if we translate the 3D points for the start, end, and control point to 2D it looks just fine. Just the way it&#8217;s supposed to. Who knew???</p>
<p>So to recap how this whole thing works&#8230; We have a Scene3D which contains some arrays defining 3D and 2D positions. Then we have a few classes that hook/reach into those arrays to modify and set those arrays. </p>
<p>But who does the actual rendering? When you write a simple 3D engine like Jam3D.js you have to make the decision will the Scene render objects or will the objects themselves render themselves. If you choose to have the Scene render the items your engine may perform a little bit better but you&#8217;ll always have to define how things are rendered in the scene and it&#8217;s hard to add in new types of items to render. To be honest at this point I was a bit nervous the creative for Bjork would change and we&#8217;d have to start rendering new types of items so I made the decision to have objects render themselves and possibly take a small performance hit. These types of decisions only really happen when dealing with clients but luckily they never wanted new types of items to render.</p>
<p>One nice thing about the creative for Bjork was that all the items are white. You couldn&#8217;t tell if the white circle that was in the distance was actually in front of the white line in the front cause they were both white. This was nice because we could skip Z-Sorting completely. This helped a lot since Z-Sorting can be one of the most processor intensive operations.</p>
<p>I knew that I didn&#8217;t have a lot of time to write out the Björk site and so I decided that I wasn&#8217;t going to write Matrix3D class. Luckily I found a great Matrix class written by <a href="http://www.daijima.jp/blog/" target="_blank">Masayuki Daijima</a> Matrices scare people a bit if you haven&#8217;t worked with them much. But really you probably all learned this stuff in grade 10 math. HEH. Really matrices are just a set of equations to transform points. (<a href="http://en.wikipedia.org/wiki/Rotation_matrix">http://en.wikipedia.org/wiki/Rotation_matrix</a> <a href="http://en.wikipedia.org/wiki/Scaling_(geometry)"></a> <a href="http://en.wikipedia.org/wiki/Transformation_matrix"></a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/07/bjork-part2-inner-workings/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Making of bj&#246;rk.com pt. 1</title>
		<link>http://labs.jam3.ca/2011/05/making-of-bjrk-com-pt-1/</link>
		<comments>http://labs.jam3.ca/2011/05/making-of-bjrk-com-pt-1/#comments</comments>
		<pubDate>Wed, 25 May 2011 15:01:31 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=713</guid>
		<description><![CDATA[About 6 months ago we were contacted by a company in the uk because of this blog post. They were particularly interested in creating an html5 experience for the Bjork&#8217;s new web site. Who wasn&#8217;t? After Steve had this to say, and experiments like 100-tweets drummed up interest, the interwebs were ready to critically acclaim [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_blogpost.jpg"><img class="alignnone size-full wp-image-793" title="bjork_blogpost" src="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_blogpost.jpg" alt="" width="537" height="296" /></a>About 6 months ago we were contacted by a company in the uk because of <a href="http://labs.jam3.ca/2010/02/html5-3d-canvas-no-way/">this blog post</a>. They were particularly interested in creating an html5 experience for the <a href="http://www.bjork.com">Bjork&#8217;s new web site</a>. Who wasn&#8217;t? After Steve had <a href="http://www.apple.com/hotnews/thoughts-on-flash/">this to say</a>, and experiments like <a href="http://9elements.com/io/projects/html5/canvas/">100-tweets</a> drummed up interest, the interwebs were ready to critically acclaim an html web experience and that&#8217;s when the <a href="http://thewildernessdowntown.com/">wilderness downtown</a> came onto the scene. It captured awards at the highest levels, and solidified the technology as a serious contender to deliver the highest quality web experiences &#8211; at least the marketing punch. When we saw the designs from <a href="http://mmparis.com/">m/m (paris)</a>, we got really excited. The mission: make it in &#8216;html5&#8242; and it had to play nice on the iPad and iPhone. We knew this was going to be one of the most challenging projects we had worked on to date.<br />
<span id="more-713"></span><br />
<a href="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_css31.jpg"><img class="alignnone size-full wp-image-797" title="bjork_css3" src="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_css31.jpg" alt="" width="537" height="327" /></a><br />
<strong>The first stab</strong><br />
We knew from the previous experiments that the iPad did not like to do thousands of draw commands on the canvas so we thought we would entertain a <a href="http://labs.jam3.ca/bjork/">pure css3 solution</a>. While the results (albeit really rough) were promising  from a performance perspective (w/ z-transforms) there were two big problems: 1. Chrome wan&#8217;t going to show the z-space and the Chrome roadmap was unclear as to when it would be supported. 2. Stylistically, flat planes in space were distorting the geometry &#8211; lines were disappearing &#8211; of course! They&#8217;re planes! A lot of work would have to go into a hybrid solution of some kind. It became clear that this was a dead end for this creative.</p>
<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_sketchup.jpg"><img class="alignnone size-full wp-image-799" title="bjork_sketchup" src="http://labs.jam3.ca/wp-content/uploads/2011/05/bjork_sketchup.jpg" alt="" width="537" height="382" /></a><br />
<strong>Working with Google Sketch-up<br />
</strong>For whatever reason, the creative team had chosen Google Sketch-up to design the galaxy. This proved to be a bit of a curveball. With thousands of lines and 3D spheres in the model, we scratched our heads wondering how we would get the data out of Sketchup and into some kind of format we could use in the browser. We spent hours googling, searching for a proven method to get the data out. We tried  <a title="Three.js" href="http://mrdoob.com/blog/post/693">three.js</a> but there wasn&#8217;t a way to make it work &#8211; managing optimization was a big concern. Our focus turned to the file types that Sketchup exported.<br />
<a href="http://labs.jam3.ca/wp-content/uploads/2011/05/bjorkinthreejs.jpg"><img class="alignnone size-full wp-image-803" title="bjorkinthreejs" src="http://labs.jam3.ca/wp-content/uploads/2011/05/bjorkinthreejs.jpg" alt="" width="537" height="335" /></a></p>
<p>We eliminated all but one sphere and one line in the galaxy and exported the file in every format possible. After a bit of poking around, the .xsi file format showed the most promise. Once opened in a text editor, we were pleased to discover we could clearly see what line data looked like and what made up a sphere. Lines had a start x,y,z and end point x,y,z. Sphere data was a bit more complicated, with a single the 3d object comprised of hundreds of mesh positions defining faces of the spherical body. A flash application was written to parse the lines and php was used to parse the sphere data, average the position in space and calculate the radius. We finally had our data.</p>
<p><strong>Drawing the galaxy</strong><br />
We had seen some promising work done by <a href="http://www.giuseppesicari.it/">Giuseppe Sicari</a> which bolstered our expectation that what we were going to attempt would work.. he was just missing a Camera you could control. It was now time to write our very own javascript 3D engine and in only a few days Mikko had made <a href="http://labs.jam3.ca/bjork3/">this</a>. There still was no camera object and we still needed to create &#8216;the compass&#8217; indicator but it was a start. High-fives were had.<br />
<a href="http://labs.jam3.ca/wp-content/uploads/2011/05/svgs.jpg"><img class="alignnone size-full wp-image-801" title="svgs" src="http://labs.jam3.ca/wp-content/uploads/2011/05/svgs.jpg" alt="" width="537" height="319" /></a><br />
<strong>Illustrator to HTML5</strong><br />
One of the key design elements in the site is the compass indicator that orients the user experience in the site. The compass is again re-used for the mobile version of the site. These design assets were provided as Illustrator files and we needed a way to express them as line data we could plot on the canvas. After hours of poking around we stumbled upon <a href="http://code.google.com/p/lindenb/wiki/SVGToCanvas">Pierre Lindenbaum&#8217;s library </a>that could convert svg to html canvas drawing commands&#8230; but of course this was not ready for us to use out of the box because our data was different. Another php script was needed to convert this drawing commands into the paths we use in our native JAM3d.js. And since the compass is comprised of two planes that intersect, the second set of paths needed to be offset onto another axis and the values painstakingly shifted to make the model symmetrically join. The fun was just starting..</p>
<p><strong>In Part 2</strong>, Mikko will explain the challenges we faced writing Jam3D.js, Camera3D and more!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/05/making-of-bjrk-com-pt-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Great Time To Be a Web Developer In An App Store Economy</title>
		<link>http://labs.jam3.ca/2011/02/great-time-to-be-a-web-developer-in-an-app-store-economy/</link>
		<comments>http://labs.jam3.ca/2011/02/great-time-to-be-a-web-developer-in-an-app-store-economy/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 17:51:57 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=507</guid>
		<description><![CDATA[
There are two main problems that developers have face:

How to get people to see your app
How to make money off that app

App stores really solve both of these issues. One of the coolest things as a web developer is the fact that there are ways to create &#8220;native&#8221; apps for these app stores using the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.jam3.ca/wp-content/uploads/2011/02/appstores_snapshot.jpg"><img src="http://labs.jam3.ca/wp-content/uploads/2011/02/appstores_snapshot.jpg" alt="" title="appstores_snapshot" width="500"  class="alignnone size-full wp-image-542" /></a><br />
There are two main problems that developers have face:</p>
<ol>
<li><strong>How to get people to see your app</strong></li>
<li><strong>How to make money off that app</strong></li>
</ol>
<p>App stores really solve both of these issues. One of the coolest things as a web developer is the fact that there are ways to create &#8220;native&#8221; apps for these app stores using the standard languages we use: <strong>html</strong>, <strong>js</strong>, <strong>css</strong>, and <strong>AS3</strong>.<br />
<span id="more-507"></span></p>
<p>Here are some platforms web developers can deploy to using the languages noted above: </p>
<style>
.appstoretable{ margin:5px;border:solid 1px #F90; font-size:10px; width:400px;} .appstoretitle { font-weight:bold; background-color:#F90; padding:4px; color:#000; } .appstoretable tr.item { background-color: #333;text-align:center; } .appstoretable tr.item2 { background-color:#000;text-align:center; } .appstoretable th { font-weight:bold; background-color:#F90; padding:8px; color:#000; } .winner {background-color:#0F0;color:#000;} .looser {background-color:#F00;color:#000;}
</style>
<table class="appstoretable">
<tr class="item">
<th>App Store</th>
<th>Platforms</th>
<th>Monetization Methods</th>
<th>Revenue</th>
<th>Payment Cycle</th>
<th>Cost</th>
<th>Minimum App Price</th>
<th>Approval Process</th>
</tr>
<tr class="item2">
<td>iOs App Store</td>
<td>iPod, iPhone, iPad</td>
<td>App Sales, In App Adds, In App Sales, Subscriptions (soon)</td>
<td>70% store 70% For App Sales 60% For Adds</td>
<td class="looser">Monthly when $150 is reached</td>
<td>$99 per year</td>
<td>$0.99</td>
<td>Yes</td>
</tr>
<tr class="item">
<td>Mac App Store</td>
<td class="looser">Apple Computers</td>
<td class="looser">App Sales</td>
<td>70%</td>
<td>Monthly</td>
<td>$99 per year</td>
<td>$0.99</td>
<td>Yes</td>
</tr>
<tr class="item2">
<td>Blackberry App World</td>
<td>Many Blackberry Phones: Blackberry Playbook</td>
<td class="winner">App Sales, In App Sales, In App Adds, Subscriptions</td>
<td>70% For App Sales 60% For Adds</td>
<td>When using Carrier Based Billing- Monthly when $50 earned. Paypal- Monthly when $100 is reached</td>
<td class="looser">$200 per 10 credits. Credits are charged on submitting an app (even if it doesnt pass the Approval process)</td>
<td>$0.99</td>
<td>Yes</td>
</tr>
<tr class="item">
<td>Chrome Web Store</td>
<td>Chrome Browsers and Chrome OS Based Devices</td>
<td>App Sales, Subscription, In App Sales, Adds (of course since its a web app you can use in app adds from AdSense or elsewhere)</td>
<td class="winner">95%-30 cent processing fee</td>
<td class="winner">2 days after a successful sale if the payout is more than $1</td>
<td>$5 one time</td>
<td>$1.99</td>
<td>Yes</td>
</tr>
<tr class="item2">
<td>Android Market</td>
<td>Android Based Devices</td>
<td>App Sales, In App Sales</td>
<td>70%</td>
<td class="winner">Changes based on country and bank but $1 must be reached</td>
<td>$25 one time + $20 to enroll for payment service</td>
<td>$0.99</td>
<td class="winner">No</td>
</tr>
<tr class="item">
<td>Nokia Ovi</td>
<td class="winner">Nokia Devices</td>
<td class="looser">App Sales</td>
<td>70%</td>
<td>Monthly when 100 euros is reached</td>
<td class="winner">1 euro one time</td>
<td>1 euro</td>
<td>Yes</td>
</tr>
</table>
<p><strong>Conclusions:</strong><br />
If you are a developer and want to start developing with minimal overhead and with <strong>huge reach</strong> the <a href="http://store.ovi.com/">Nokia Ovi store</a> is the way to go. The Apple iDevices are extremely popular in North America but worldwide Nokia is still a HUGE player with bigger reach.</p>
<p>The <a href="https://chrome.google.com/webstore">Chrome web store</a> is the most <strong>straightforward</strong> option for web developers. The sign up fee is very minimal and there are no other tools you need to learn (or buy) to deploy apps. Out of all the stores the Chrome web store takes the <strong>smallest cut</strong> however it&#8217;s a very new platform and doesn&#8217;t have the same user counts the other platforms can boast. The $1.99 minimum app price point is interesting in that as a developer you will not be competing against $0.99 apps however it being a new platform it could deter users.</p>
<p>Even though neither of the <a href="http://itunes.apple.com/us/genre/ios/">Apple</a> <a href="http://www.apple.com/mac/app-store/">stores</a> won in any of the columns they are obviously still a great option to develop for. They were the first platform to have an app store and so the other app stores are definitely trying to compete against Apple&#8217;s stores and with good reason. The iOs store still <strong>sells the most apps</strong> out of any store.</p>
<p>The <a href="https://market.android.com/">Android market</a> shouldn&#8217;t be forgotten as it is currently the biggest competitor in app sales vs the Apple store. Enrollment fees are quite a bit lower than the Apple store&#8217;s and it&#8217;s nice that they <strong>payout developers quite often</strong>.</p>
<p><a href="http://appworld.blackberry.com/webstore/">Blackberry App World</a> is an interesting underdog. Currently it&#8217;s receiving A LOT of developer support especially from the Flash Platform community because of the <a href="http://us.blackberry.com/playbook-tablet/">Blackberry Playbook</a> and <a href="http://devblog.blackberry.com/2010/10/blackberry-playbook-developer-promotion-information/">this promotion</a>. It&#8217;s very cool that they&#8217;ve been working on app monetization strategies more than anyone else. This gives the most avenues for developers to make money. Cost for being a App World developer is much too high though. (although currently the initial $200 fee is waved) Unlike the other stores where you pay a one time fee or anually in the App World developers pay <strong>$200 to receive 10 credits</strong>. One credit is used per app you submit. You will not receive your credit back if your application fails the QA process. You will also have to use one credit to update your app. This to me is <strong>ridiculous!</strong> In order to maintain quality of applications developers should not be penalized.</p>
<p>Overall the great news is that using the languages you know with some new tools you can target most, if not all of these platforms. (more on these tools in a future post)</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/02/great-time-to-be-a-web-developer-in-an-app-store-economy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Safari beats Chrome &#8211; HTML5 Canvas drawing method performance</title>
		<link>http://labs.jam3.ca/2011/02/safari-beats-chrome-html5-canvas-drawing-method-performance/</link>
		<comments>http://labs.jam3.ca/2011/02/safari-beats-chrome-html5-canvas-drawing-method-performance/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 04:10:22 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Category==Null]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[canvas3d]]></category>
		<category><![CDATA[google sketchup]]></category>
		<category><![CDATA[jam3d]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=468</guid>
		<description><![CDATA[Recently we were engaged by a company in the UK and some designers based out of Paris, to bring a 3D model designed in Google SketchUp to life online. This would hardly be noteworthy had we been allowed to use Flash to deliver an interactive experience. But for this project, we were specifically tasked to [...]]]></description>
			<content:encoded><![CDATA[<p>Recently we were engaged by a company in the UK and some designers based out of Paris, to bring a 3D model designed in Google <a href="http://sketchup.google.com/">SketchUp</a> to life online. This would hardly be noteworthy had we been allowed to use Flash to deliver an interactive experience. But for this project, we were specifically tasked to use HTML5 friendly techniques.  Thank you Mr. Jobs. Unfortunately, we can&#8217;t share any links at this time but we promise we will share once we launch. So what happens when you try to draw 8000+ lines on a canvas?</p>
<div id="attachment_469" class="wp-caption alignnone" style="width: 602px"><a href="http://labs.jam3.ca/wp-content/uploads/2011/02/constellation_snapshot.jpg"><img style="border: solid 1px #FFF;" class="size-full wp-image-469" title="constellation_snapshot" src="http://labs.jam3.ca/wp-content/uploads/2011/02/constellation_snapshot.jpg" alt="" width="530" /></a><p class="wp-caption-text">...snapshot of the &quot;constellation&quot; of lines and &#39;spheres&#39;</p></div>
<p><span id="more-468"></span><br />
The model, aka the &#8220;constellation&#8221; pictured above, had over 8000 lines and over 300 spheres. The designer, thankfully, had used a monochromatic palette. This was a good thing because it meant that we would not have to worry about z-sorting the lines and circles. Our mission was to render this puppy, fly around and cull what we couldn&#8217;t see.</p>
<p>Once we had parsed the data (that&#8217;s a future post and a half), we were ecstatic, it was nearly imperceptibly different from what we were seeing in SketchUp&#8230; but.. then we glanced at our frame rate stats and we were only getting 9fps. As we moved our camera in and out we saw the fps hover between 4-9fps. We thought, ok, maybe Safari on mac is not as fast as Chrome. Alas! Chrome was performing slighly worse, with a lower bottom end at 3-6fps.</p>
<p>Where was our sweet spot? How many lines and spheres can one draw on the canvas and achieve acceptable frame rates? What is more taxing, lines or spheres? We would be happy with 20fps. We broke out the lab coats and went to work creating versions of the constellation with decreasing amounts of lines and spheres. We also separated the lines from the spheres and ran some tests independently. Keep in mind, that this is not uniform test since, as you can see in the screenshot above, the lines are not spread evenly in x,y or z space nor are the total number of lines and circles drawn on screen at any given time. So this is also a test of pure javascript performance, looping through the arrays and deciding if a line should be drawn.</p>
<p><strong>The Tests</strong></p>
<p>We ran 3 tests. For our 1st test, we took every third, then fourth line etc. from the original 8847 lines in the array. The second and third test gave us insight into how much overhead the circles were adding to the drawing methods.</p>
<p>We wanted to share our findings with respect to the performance (measured in fps) we recorded in FireFox, Chrome and Safari on the Mac and their counterparts on the PC. All tests were conducted at 1200&#215;800. We were also very interested in seeing how  the HTML5 canvas performed on the iPad because part of the end project is to produce similar results in the browser on the iPhone and iPad. All of these browsers <a title="Find me by IP" href="http://www.findmebyip.com/litmus" target="_blank">support the canvas</a> and some browsers have even fashioned <a title="Chrome Speed Test" href="http://www.youtube.com/watch?v=nCgQDjiotG0">marketing campaigns</a> around their performance. But what we found surprising was the chasm separating the slowest from the fastest frame rates.</p>
<p>As you will see in the tables below, Firefox was pathetically slow at rendering the model on both mac and pc. Safari was better than Chrome for some reason, as it is widely believed Chrome owns the distinction of being the fastest browser.</p>
<p>In Test 2 and 3, you can see that drawing the circles was not an insignificant overhead, representing  a 2-5 frame jump at the lower end of the range.</p>
<style>
.benchtable{ margin:5px;border:solid 1px #F90; font-size:10px; } .benchtitle { font-weight:bold; background-color:#F90; padding:4px; color:#000; } .benchtable th.item { background-color:#666; } .benchtable th.item2 { background-color:#888; } .benchtable th { font-weight:bold; background-color:#999; padding:4px; color:#000; } .winner {background-color:#0F0;color:#000;}
</style>
<table class="benchtable">
<tbody>
<tr>
<td class="benchtitle" colspan="6">Test 1: All, Every 3rd, 4th, 5th , 6th and 7th line element</td>
</tr>
<tr>
<td></td>
<th>Chrome (mac)</th>
<th class="winner">Safari (mac)</th>
<th>Safari 5.0.3 (pc)</th>
<th>Chrome 5.0.375 (pc)</th>
<th>Firefox 3.6.2 (pc)</th>
</tr>
<tr>
<th class="item">8847 lines</th>
<td>2-5fps</td>
<td>4-7fps</td>
<td class="winner">4-9fps</td>
<td>3-6fps</td>
<td>2-3fps</td>
</tr>
<tr>
<th class="item2">2949 lines</th>
<td>8-14fps</td>
<td>9-19fps</td>
<td class="winner">10-15fps</td>
<td>7-12fps</td>
<td>2-13fps</td>
</tr>
<tr>
<th class="item">2212 lines</th>
<td>9-16fps</td>
<td class="winner">12-23fps</td>
<td>11-17fps</td>
<td>10-17fps</td>
<td>6-16fps</td>
</tr>
<tr>
<th class="item2">1770 lines</th>
<td>12-19fps</td>
<td class="winner">14-24fps</td>
<td>13-20fps</td>
<td>11-20fps</td>
<td>1-19fps</td>
</tr>
<tr>
<th class="item">1475 lines</th>
<td>12-21fps</td>
<td class="winner">15-25fps</td>
<td>14-19fps</td>
<td>12-21fps</td>
<td>9-21fps</td>
</tr>
<tr>
<th class="item2">1264 lines</th>
<td>15-23fps</td>
<td class="winner">16-26fps</td>
<td>15-20fps</td>
<td>12-16fps</td>
<td>9-21fps</td>
</tr>
<tr>
<td class="benchtitle" colspan="6">Test 2: Lines and Circles</td>
</tr>
<tr>
<td></td>
<th>iPad (gen1)</th>
<th>Safari (mac)</th>
<th>Safari 5.0.3 (pc)</th>
<th>Chrome 5.0.375 (pc)</th>
<th>Firefox 3.6.2 (pc)</th>
</tr>
<tr>
<th class="item">1000 Lines 263 Circles</th>
<td>3-9fps</td>
<td class="winner">25-49fps</td>
<td>17-24fps</td>
<td>12-18fps</td>
<td>13-18fps</td>
</tr>
<tr>
<th class="item2">800 Lines 263 Circles</th>
<td>3-10fps</td>
<td class="winner">28-50fps</td>
<td>18-21fps</td>
<td>14-29fps</td>
<td>11-24fps</td>
</tr>
<tr>
<th class="item">600 Lines 263 Circles</th>
<td>4-12fps</td>
<td class="winner">34-57fps</td>
<td>17-23fps</td>
<td>15-22fps</td>
<td>18-29fps</td>
</tr>
<tr>
<th class="item2">400 Lines 263 Circles</th>
<td>6-13fps</td>
<td class="winner">34-58fps</td>
<td>18-24fps</td>
<td>16-22fps</td>
<td>18-29fps</td>
</tr>
<tr>
<th class="item">200 Lines 263 Circles</th>
<td>5-13fps</td>
<td class="winner">49-91fps</td>
<td>22-25fps</td>
<td>11-22fps</td>
<td>27-35fps</td>
</tr>
<tr>
<td class="benchtitle" colspan="6">Test 3: No Circles</td>
</tr>
<tr>
<td></td>
<th>iPad (gen1)</th>
<th>Safari (mac)</th>
<th>Safari 5.0.3 (pc)</th>
<th>Chrome 5.0.375 (pc)</th>
<th>Firefox 3.6.2 (pc)</th>
</tr>
<tr>
<th class="item2">1000 Lines 0 Circles</th>
<td>4-11fps</td>
<td class="winner">29-48fps</td>
<td>21-37fps</td>
<td>18-30fps</td>
<td>18-33fps</td>
</tr>
<tr>
<th class="item">800 Lines 0 Circles</th>
<td>4-12fps</td>
<td class="winner">34-52fps</td>
<td>27-39fps</td>
<td>20-32fps</td>
<td>22-34fps</td>
</tr>
<tr>
<th class="item2">600 Lines 0 Circles</th>
<td>4-13fps</td>
<td class="winner">38-71fps</td>
<td>28-41fps</td>
<td>24-43fps</td>
<td>22-42fps</td>
</tr>
<tr>
<th class="item">400 Lines 0 Circles</th>
<td>7-14fps</td>
<td class="winner">54-89fps</td>
<td>36-42fps</td>
<td>28-36fps</td>
<td>34-43fps</td>
</tr>
<tr>
<th class="item2">200 Lines 0 Circles</th>
<td>10-27fps</td>
<td class="winner">82-135fps</td>
<td>27-52fps</td>
<td>42-64fps</td>
<td>38-57fps</td>
</tr>
</tbody>
</table>
<p>While we acknowledge this isn&#8217;t completely a fair test, it shows you that Chrome is not necessarily king, and that there is serious room for improvement from Firefox. We look forward to updating this post with some numbers run against FF4 and Chrome 9. Perhaps the best news was that Safari performed well for us, and is considered the target browser for the project. We will update this post in the coming weeks with greater detail about this project as this data has more to tell us about the performance of canvas drawing methods across the browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2011/02/safari-beats-chrome-html5-canvas-drawing-method-performance/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTML/CSS 3D Particles On The iPad</title>
		<link>http://labs.jam3.ca/2010/11/htmlcss-3d-particles-on-the-ipad/</link>
		<comments>http://labs.jam3.ca/2010/11/htmlcss-3d-particles-on-the-ipad/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 21:20:15 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[js]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=451</guid>
		<description><![CDATA[Before you continue reading it should be noted that for this experiment we specifically wanted to create 3D particles on the iPad. Therefore this will not work in Chrome or Firefox on your computer. It will however work in Safari.
When we started this our first instinct was to develop this using the new HTML5 Canvas [...]]]></description>
			<content:encoded><![CDATA[<p>Before you continue reading it should be noted that for this experiment we specifically wanted to create 3D particles on the iPad. Therefore this will not work in Chrome or Firefox on your computer. It will however work in <strong>Safari</strong>.</p>
<p>When we started this our first instinct was to develop this using the new <strong>HTML5 Canvas</strong> tag. So we did and it didn&#8217;t perform at all&#8230;</p>
<p>We were a little bit upset&#8230;</p>
<p>Then one morning I was reading through my <strong>RSS</strong> feeds and stumbled across this article:<br />
<a href="http://blog.jackadam.net/2010/3d-rotating-molecules-on-the-iphoneipad/">http://blog.jackadam.net/2010/3d-rotating-molecules-on-the-iphoneipad/</a></p>
<p>They were using a different approach. Instead of using <strong>Canvas</strong> they were using <strong>CSS</strong> and the <strong>-webkit-transform</strong> tag heavily.</p>
<p>We implemented a similar solution and it worked great on the iPad and surprisingly on a iPhone 3Gs.</p>
<p><iframe src="http://player.vimeo.com/video/16477573?portrait=0&amp;color=f40044" width="540" height="304" frameborder="0"></iframe></p>
<p><a href="http://labs.jam3.ca/wp-content/uploads/2010/11/ipad3dParticles/">Go Here To See This Experiment In Action</a> (remember Safari Only)</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2010/11/htmlcss-3d-particles-on-the-ipad/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTML5 3D Canvas, no way!</title>
		<link>http://labs.jam3.ca/2010/02/html5-3d-canvas-no-way/</link>
		<comments>http://labs.jam3.ca/2010/02/html5-3d-canvas-no-way/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 22:04:49 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[R&D]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=217</guid>
		<description><![CDATA[Well, not really, but i figured with all the HTML5 and Canvas hype i might as well give it a go. So i decided to port the pseudo 3D application i wrote for www.stemcellcharter.org. Turns out canvas is pretty cool, and it runs pretty well to boot, well, at least on webkit browsers. It runs [...]]]></description>
			<content:encoded><![CDATA[<p>Well, not really, but i figured with all the <strong>HTML5</strong> and Canvas hype i might as well give it a go. So i decided to port the pseudo <strong>3D</strong> application i wrote for <a title="Stemcell Foundation" href="http://www.stemcellcharter.org" target="_blank">www.stemcellcharter.org</a>. Turns out canvas is pretty cool, and it runs pretty well to boot, well, at least on webkit browsers. It runs pretty well on Firefox too, but you can see it stutter every once in a while.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="540" height="405" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=9332712&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=f40044&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="540" height="405" src="http://vimeo.com/moogaloop.swf?clip_id=9332712&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=f40044&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>If you want to see the actual page, <a title="3D Canvas" href="http://labs.jam3.ca/wp-content/uploads/2010/02/index.html">Click here to get a taste.</a></p>
<p>I will definitely be looking into the canvas a bit more, but like Mikko said, i don&#8217;t think this is the <strong>“Flash Killer”</strong> just yet. But hey, I&#8217;ve got no problem experimenting with it. Its a nice break from Flash anyways.</p>
<p>What to build next&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2010/02/html5-3d-canvas-no-way/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>HTML5 Canvas Version of the Voxel Engine</title>
		<link>http://labs.jam3.ca/2010/02/html5-canvas-version-of-the-voxel-engine/</link>
		<comments>http://labs.jam3.ca/2010/02/html5-canvas-version-of-the-voxel-engine/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 16:43:09 +0000</pubDate>
		<dc:creator>Mikko</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[R&D]]></category>
		<category><![CDATA[Radiohead]]></category>
		<category><![CDATA[Voxel Engine]]></category>

		<guid isPermaLink="false">http://labs.jam3.ca/?p=22</guid>
		<description><![CDATA[Last night I decided it was time to take a break from the Voxel Engine and work on the Voxel Engine. HEH&#8230;
I know that makes no sense but basically I started thinking with all this hype around HTML5 and Canvas I better try to build something in HTML5 and Canvas in order to know what [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I decided it was time to take a <strong>break</strong> from the <strong>Voxel Engine</strong> and work on the <strong>Voxel Engine</strong>. HEH&#8230;</p>
<p>I know that makes no sense but basically I started thinking with all this hype around <strong>HTML5</strong> and <strong>Canvas</strong> I better try to build something in HTML5 and Canvas in order to know <strong>what it&#8217;s all about</strong>. With HTML5 and Canvas being touted as the <strong>&#8220;Flash Killer&#8221;</strong> I decided to try and see if it was possible to build the Voxel Engine using Javascript and the Canvas tag.</p>
<p>Here is a short video of the Javascript Canvas based Voxel Engine running in <strong>Safari:</strong></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="540" height="405" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=9168749&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=f40044&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="540" height="405" src="http://vimeo.com/moogaloop.swf?clip_id=9168749&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=f40044&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>You can see it in action by clicking below.<br />
However we recommend that you use Safari or Google Chrome:</strong><br />
<a href="http://labs.jam3.ca/wp-content/uploads/2010/02/canvasVoxels.html">Click Here To See It in Action</a></p>
<p>This was an interesting experiment but from this I can say that right now HTML5 and Canvas is <strong>NOT yet the &#8220;Flash Killer&#8221;</strong> it&#8217;s being touted as. The performance on this experiment is quite a bit lower than what Flash can produce. I mean it doesn&#8217;t even run in <strong>Firefox</strong>, and this is the core of the problem with HTML and Javascript for years, browsers just aren&#8217;t built the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.jam3.ca/2010/02/html5-canvas-version-of-the-voxel-engine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

