<?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>Promethe's Blog &#187; DirectFlex</title>
	<atom:link href="http://blog.promethe.net/tag/directflex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.promethe.net</link>
	<description>Web, RIAs and chocolate spaghettis...</description>
	<lastBuildDate>Tue, 29 Jun 2010 09:24:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>New DirectFlex experiments: &#8216;FPS&#8217; and &#8216;Earth&#8217;</title>
		<link>http://blog.promethe.net/2009/06/12/new-directflex-experiments/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=new-directflex-experiments</link>
		<comments>http://blog.promethe.net/2009/06/12/new-directflex-experiments/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 11:16:58 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[DirectFlex]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=337</guid>
		<description><![CDATA[I just posted and blogged about a few new experiments built using DirectFlex on Direct Flex Labs: FPS: is it possible to display Half Life 1 graphics in Flash ? I don't know yet... but this experiment is an improvement of the one I posted a while back Earth: I always wanted to implement the [...]]]></description>
			<content:encoded><![CDATA[<p>I just posted and blogged about a few new experiments built using <a href="http://blog.directflex.net/" target="_blank">DirectFlex</a> on <a href="http://labs.directflex.net" target="_blank">Direct Flex Labs</a>:</p>
<ul>
<li><a href="http://labs.directflex.net/experiment/view?id=4" target="_blank">FPS</a>: is it possible to display Half Life 1 graphics in Flash ? I don't know yet... but this experiment is an improvement of <a href="http://blog.promethe.net/2008/12/24/display-half-life-3d-models-with-flash-10/">the one I posted a while back</a></li>
<li><a href="http://labs.directflex.net/experiment/view?id=7" target="_blank">Earth</a>: I always wanted to implement the famous Google Earth in Flash. This might be a good first step! I made this experiment in approximately 1 hour to test out a few new features</li>
</ul>
<p>Please let me know what you think about those new experiments. Any feedback will be greatly appreciated!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2009/06/12/new-directflex-experiments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display Half Life 3D models with Flash 10</title>
		<link>http://blog.promethe.net/2008/12/24/display-half-life-3d-models-with-flash-10/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=display-half-life-3d-models-with-flash-10</link>
		<comments>http://blog.promethe.net/2008/12/24/display-half-life-3d-models-with-flash-10/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 19:40:56 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[3DS]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[DirectFlex]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=273</guid>
		<description><![CDATA[UPDATE: you can find a newer version on the DirectFlex Blog. It's been a while since the last post. But I'm back and I decided to release the first DirectFlex demo ever This demo is quite simple and features a 3D model extracted from the famous Half Life 1 add on Counter-Strike 1.6. The model [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>UPDATE</strong>: you can find a newer version on the <a href="http://blog.directflex.net/2009/06/11/labs-new-fps-experiment/" target="_blank">DirectFlex Blog</a>.</span></p>
<p>It's been a while since the last post. But I'm back and I decided to release the first DirectFlex demo ever <img src='http://blog.promethe.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>This demo is quite simple and features a 3D model extracted from the famous Half Life 1 add on Counter-Strike 1.6. The model is made of "only" 740 polygons, which is not much compared to what DirectFlex can do. Still, being able to display Half Life 1 models inside of Flash with a decent framerate brings hope for future developments. Anyway it is a good proof that DirectFlex is (way) faster than any other Flash 3D "engine" out there... but hey! live demo first and then technical stuff... (<strong><span style="color: #ff0000;">Flash 10 required!</span></strong>)</p>
<p><a rel="shadowbox[dflex_demo];width=640;height=480" href="http://blog.promethe.net/wp-content/uploads/2008/12/fpsdemo.swf"><img class="aligncenter size-medium wp-image-282" title="dflex_fpsdemo_preview1" src="http://blog.promethe.net/wp-content/uploads/2008/12/dflex_fpsdemo_preview1.png" alt="" width="300" height="223" /></a><br />
<span id="more-273"></span></p>
<p><strong>First Person Shooter Camera</strong></p>
<p><strong> </strong>This demo features one of the camera classes provided by DirectFlex: FPSCamera. This camera mimics the behavior of a any "classic" doom-like FPS game. Simple use the arrows/AWSD to walk forward/backward/strafe. You can also use the mouse to look around. Nothing fancy except the camera class itself which is really lightweight and easy to overload: I actually created a GhostCamera class based on the FPSCamera class by just adding 2 lines of code... All the camera classes are based on the same AbstractCamera class which makes it possible and really easy to switch from one camera type to another in real time in your application. I will release another demo to show how simple the code actually is.</p>
<p><strong>3DS Loader</strong></p>
<p><strong></strong>A good opportunity to show the 3DS loader in action. Loading and parsing are obviously really fast. The 3DS file is embed inside the SWF file which of course makes it even faster. The 3DS loader was built using <a href="http://www.spacesimulator.net/tut4_3dsloader.html" target="_blank">this documentation</a>.</p>
<p><strong>Texture Mapping</strong></p>
<p>The texture I used is the original one. I just resized it to make the final SWF file lighter. Nothing crazy about it except that it looks perfectly fine without cutting down the framerate.</p>
<p><strong>Embed Assets</strong></p>
<p>The texture and the 3D model files are embed inside the final SWF file. The mesh and texture class provided by DirectFlex can load such embed assets natively. It is very useful when you just want to redistribute your application without taking care of deploying the assets on a web server and dealing with security issues.</p>
<p><strong>Real Time Lighting</strong></p>
<p>As you can see, the back of the model is completely black. It does not mean that the texture is actually black <img src='http://blog.promethe.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Each polygon is skinned then lighted using a "fake" Phong algorithm. It is a very first draw and a lot of thinking has to be done to make it actually user friendly. Still, because the light and the model are not moving the "real time" part is not really obvious here... I'll try to make it more fancy in the next demo.</p>
<p><strong>About performances</strong></p>
<p>The framerate counter indicates 20-25 frames per second. The application does not force the framerate so the Flash Player runs it at the default framerate (which is supposed to be 24 frames per second). Then, a 20 to 25 frames per second framerate is actually as smooth as it is supposed to be <img src='http://blog.promethe.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  It runs perfectly on my Atom 1.6Ghz processor so I guess any decent computer should run it without any performance issue of any kind.</p>
<p><strong>Known issues</strong></p>
<p>The mouse is not handled properly and its sensitivity will depend on the framerate of the application. If your framerate is to high, looking around <em>might</em> be tricky. I know how to fix that but I'm just to lazy to do it for this first demo <img src='http://blog.promethe.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Z-sorting is not (yet) functional and some glitches might appear. I chose the 3D model carefully so that no major visual defects would occur.</p>
<p>Clipping and frustrum culling are not fully implemented. Major artifacts might appear when the model is rendered is the "back" of the camera.</p>
<p><strong>What's next ?</strong></p>
<p>A MD5 (Doom 3 models) loader is on its way and I will certainly try to load Half Life 2 models too. I am currently working with <strong>Alchemy</strong> v0.5a to build a fast C++ implementation of BSP trees to implement an efficient and reliable z-sorting algorithm. I will definitely post about Alchemy and my whole C/C++ to AS3 work. I will also release a very cool <a href="http://en.wikipedia.org/wiki/Heightmap" target="_blank">heightmap</a> demo soon, with some source code to show how user friendly DirectFlex actually is. Other cool demos will follow... Finally, the official DirectFlex blog will be launched soon!</p>
<p>Do not hesitate to post any ideas and comments about how smooth the demo runs on your computer for example.</p>
<p><strong></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2008/12/24/display-half-life-3d-models-with-flash-10/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Display Nintendo Wii 3D models in Flash!</title>
		<link>http://blog.promethe.net/2008/11/18/display-nintendo-wii-3d-models-in-flash/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=display-nintendo-wii-3d-models-in-flash</link>
		<comments>http://blog.promethe.net/2008/11/18/display-nintendo-wii-3d-models-in-flash/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 02:33:17 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[DirectFlex]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=214</guid>
		<description><![CDATA[A few posts ago, I wrote about the fact that DirectFlex was able to load and display Nintendo 64 3d models. You can found this post and a few screenshots here. This experiment was made using the Flash 9 version of DirectFlex, and a lot of things have changed since then. Here we are, with [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">A few posts ago, I wrote about the fact that DirectFlex was able to load and display Nintendo 64 3d models. You can found this post and a few screenshots <a title="DirectFlex : work with Nintendo64 3D models" href="http://blog.promethe.net/2008/09/22/directflex-work-with-nintendo-64-3d-models/" target="_blank">here</a>. This experiment was made using the Flash 9 version of DirectFlex, and a lot of things have changed since then. Here we are, with a brand new version of DirectFlex specially designed to take advantage of the new features of Flash 10.</p>
<p style="text-align: justify;"><strong>DirectFlex new features</strong> <strong>and Wii 3D models rendering</strong></p>
<p>The new Flash 10 version of DirectFlex comes with a lot of new features such as:</p>
<ul>
<li>New architecture</li>
<li>Improved performances</li>
<li>Texture coordinates support</li>
<li>3DS files support</li>
<li>Embed assets (textures and 3D models) support</li>
<li>Pre-made camera classes</li>
</ul>
<p style="text-align: justify;">A good example of those new features is the fact that DirectFlex is now able to load and display Nintendo Wii 3D models. To make this new experiment I downloaded "<strong>Zelda : Twillight Princess</strong>" 3D models. Those models have been ripped from the original Wii game and are easily available on google. Because a picture is worth a thousand words, here are a few screenhots:</p>
<p style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/11/dflex_goron_1.png" rel="shadowbox[post-214];player=img;"><img class="size-medium wp-image-218 aligncenter" src="http://blog.promethe.net/wp-content/uploads/2008/11/dflex_goron_1.png" alt="" width="300" height="224" /></a></p>
<p><span id="more-214"></span></p>
<p style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/11/dflex_goron_2.png" rel="shadowbox[post-214];player=img;"><img class="size-medium wp-image-219 aligncenter" title="dflex_goron_2" src="http://blog.promethe.net/wp-content/uploads/2008/11/dflex_goron_2.png" alt="" width="300" height="224" /></a></p>
<p style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/11/dflex_goron_3.png" rel="shadowbox[post-214];player=img;"><img class="size-medium wp-image-220 aligncenter" title="dflex_goron_3" src="http://blog.promethe.net/wp-content/uploads/2008/11/dflex_goron_3.png" alt="" width="300" height="225" /></a></p>
<p style="text-align: justify;">Those screenshots are the very first of the Flash 10 flavor of DirectFlex. I chose to render a Goron, a legendary creature of the Zelda universe. But I can hear you wondering : "Why ?! Why a *&amp;*%#@ goron ?! We want Link!". Well the reason is very simple: the 3DS loader and the optimizations I added are still quite experimental and a few bugs remain when I load Link's 3DS model... Too bad! But I am sure I will come up with a solution soon!</p>
<p style="text-align: justify;"><strong>But it is not that easy...</strong></p>
<p style="text-align: justify;">The main problem with those Wii ripped models is not the number of primitives itself but the fact that they are not really real-time rendering friendly: they are subdivided in a lot of subsets.  Therefor, they are easier to edit and to manipulate inside a 3D editor such as 3DS Max. The problem is that each of those subsets have to be rendered one after the other and at each frame. Thus, a lot a function calls occur which causes a huge framerate breakdown. A good solution would be to merge all subsets to get only one giant mesh. But usually, each subset must be rendered with a specific material/texture so you can not just blindly merge all subsets together. Hopefully, I managed to implement a bunch of new features that makes it possible and very functional!</p>
<p style="text-align: justify;">This is still experimental but is defenitely worth exploring. I will release a live SWF demo as soon as camera controls will be more efficient.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2008/11/18/display-nintendo-wii-3d-models-in-flash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DirectFlex : introducing the API layer</title>
		<link>http://blog.promethe.net/2008/09/22/directflex-introducing-the-api-layer/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=directflex-introducing-the-api-layer</link>
		<comments>http://blog.promethe.net/2008/09/22/directflex-introducing-the-api-layer/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 12:27:22 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[DirectFlex]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=137</guid>
		<description><![CDATA[Remember remember... (the fifth of november ?!) what is the main point about DirectFlex ? It "looks like" DirectX (at least the API layer does). But what does that mean exactly ? It means that a lot of things are the same. Not only design concepts but also prototypes and names. But because I'm quite [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Remember remember... (the fifth of november ?!) what is the main point about DirectFlex ? It "looks like" DirectX (at least the API layer does). But what does that mean exactly ? It means that a lot of things are the same. Not only design concepts but also prototypes and names. But because I'm quite sure that most of the flash developpers never did any DirectX programmation, I think it's worth a little explanation. I won't talk very precisely about class definitions and prototypes but I will just try to explain the global logic of DirectFlex' API layer and how to use it to draw a simple cube.</p>
<p style="text-align: justify;"><span id="more-137"></span></p>
<p><strong>The Vertex class</strong></p>
<p style="text-align: justify;">3D graphics is about drawing shapes in a 3D space. To describe those shapes, we use vertices. Considering a triangle, each corner is a vertex and will be represented by a Vertex object. Therefore, Vertex objects are basically a set of 3D coordinates that stands for the actual position of the Vertex in a 3D space. Vertex objects also contain other data such as texture coordinates, a color and a normal but we won't complicate things any further for the moment. The following code sample creates a Vertex:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// create a vertex in (x = 42, y = 23, z = 11)</span>
<span style="color: #000000; font-weight: bold;">var</span> v : Vertex = <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">42</span>, <span style="color: #cc66cc;">23</span>, <span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong>The VertexBuffer class</strong></p>
<p style="text-align: justify;">VertexBuffer objects are arrays of Vertex objects. Their implementation is actually quite more complicated because they have some internal optimizations. Still, VertexBuffer objects allow you to create a 3D shape using Vertex objects. Considering that a shape is made of triangles, the corresponding VertexBuffer object will contain multiple Vertex objects where each set of 3 Vertex is a triangle.</p>
<p style="text-align: justify;">Lets take a cube for example. The cube has 6 faces, but each face is a square. As we can draw only triangles, each face will be made of 2 triangles. Our cube is made of 6 x 2 = 12 triangles and each triangle needs 3 vertices to be fully described. In the end, the VertexBuffer of a cube will contain 12 * 3 = 36 Vertex. Each set of 3 vertices describing the triangle to draw. The following code sample create a cube's VertexBuffer:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// create a cube VertexBuffer</span>
<span style="color: #000000; font-weight: bold;">var</span> cube = <span style="color: #000000; font-weight: bold;">new</span> VertexBuffer<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                            <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong>The IndexBuffer class</strong></p>
<p style="text-align: justify;">With the previous example, it is quite obvious that a VertexBuffer alone is not the best way to describe 3D geometry. When you look at a cube, the most intuitive idea is that it is actually made of 8 vertices, not 36 ! Considering the resulting VertexBuffer, it is easy to see that vertices are created more than once with the exact same values because of the '3 vertices per triangle' logic. That is why IndexBuffer are handy : instead of describing the drawing order and the geometry in the same (Vertex) buffer, we separate them into a VertexBuffer (the geometry) and an IndexBuffer (the drawing order). Thus, an IndexBuffer is just an array of integers where each value references a cell of the VertexBuffer to describe how each Vertex has to be used. Our cube can then be represented as following :</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// create the cube's VertexBuffer</span>
<span style="color: #000000; font-weight: bold;">var</span> vb = <span style="color: #000000; font-weight: bold;">new</span> VertexBuffer<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                          <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                          <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                          <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                          <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                          <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                          <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, -<span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span>,
                          <span style="color: #000000; font-weight: bold;">new</span> Vertex<span style="color: #66cc66;">&#40;</span>-<span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span>, <span style="color: #cc66cc;">0.5</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">// create the cube's IndexBuffer</span>
<span style="color: #000000; font-weight: bold;">var</span> ib = <span style="color: #000000; font-weight: bold;">new</span> IndexBuffer<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">3</span>,
                         <span style="color: #cc66cc;">6</span>, <span style="color: #cc66cc;">5</span>, <span style="color: #cc66cc;">4</span>, <span style="color: #cc66cc;">7</span>, <span style="color: #cc66cc;">6</span>, <span style="color: #cc66cc;">4</span>,
                         <span style="color: #cc66cc;">4</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">3</span>, <span style="color: #cc66cc;">3</span>, <span style="color: #cc66cc;">7</span>, <span style="color: #cc66cc;">4</span>,
                         <span style="color: #cc66cc;">6</span>, <span style="color: #cc66cc;">7</span>, <span style="color: #cc66cc;">3</span>, <span style="color: #cc66cc;">3</span>, <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">6</span>,
                         <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">6</span>, <span style="color: #cc66cc;">6</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">5</span>,
                         <span style="color: #cc66cc;">4</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">4</span>, <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong>The Device class</strong></p>
<p style="text-align: justify;">In DirectX, the Device (also called "context device") is an object that abtracts the graphics hardware. When you want to draw vertices, you give them to the Device and it uses its current configuration to render them. In DirectFlex, the Device class implements the <a href="http://en.wikipedia.org/wiki/Facade_pattern">Facade</a> design pattern and is designed to abstract the whole "core" layer. The good thing is that the Device is a major abstraction feature : what is happening to the data stays hidden inside the core layer. If we rewrite the entire core layer, nothing will have to be changed inside the API layer! A Device object is created for each 3D display. The Device can be used in order to :</p>
<ul>
<li>set transformations (world, view, projection)</li>
<li>set materials (color fills, textures)</li>
<li>draw primitives (VertexBuffer)</li>
<li>draw indexed primitives (VertexBuffer + IndexBuffer)</li>
<li>render the scene</li>
</ul>
<p style="text-align: justify;">It is quite obvious that anything you will try to display will have to interact with the Device... Lets take our favorite cube : it's time to draw it !</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// create a device and render the cube's VertexBuffer</span>
<span style="color: #000000; font-weight: bold;">var</span> device : Device = <span style="color: #000000; font-weight: bold;">new</span> Device<span style="color: #66cc66;">&#40;</span>canvas<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// draw the VertexBuffer using the VertexBuffer : the first argument describe what kind of primitives </span>
<span style="color: #808080; font-style: italic;">// we are drawing</span>
device.<span style="color: #006600;">drawIndexedPrimitives</span><span style="color: #66cc66;">&#40;</span>PrimitiveType.<span style="color: #006600;">TRIANGLE_LIST</span>, vb, ib<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p style="text-align: justify;">The first argument of the Device constructor is a Canvas object. This object will be used by DirectFlex to know "where" and "how" it has to draw. This is what you get in the end (I added a transformation to show it's a real cube):</p>
<p style="text-align: center"><a href="http://blog.promethe.net/wp-content/uploads/2008/09/directflex_flash10_cube.jpg" rel="shadowbox[post-137];player=img;"><img src="http://blog.promethe.net/wp-content/uploads/2008/09/directflex_flash10_cube-300x248.jpg" alt="" title="directflex_flash10_cube" width="300" height="248" class="aligncenter size-medium wp-image-184" /></a></p>
<p style="text-align: justify;">This screenshot was made using the new Flash 10 version of DirectFlex ! This is why it looks that crappy : lights and a lot of stuff are not handled yet.</p>
<p><strong>What's next ?</strong><br />
Next time I will introduce 3D transformations (such as translation, rotation and scaling) and materials.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2008/09/22/directflex-introducing-the-api-layer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DirectFlex : work with Nintendo64 3D models</title>
		<link>http://blog.promethe.net/2008/09/22/directflex-work-with-nintendo-64-3d-models/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=directflex-work-with-nintendo-64-3d-models</link>
		<comments>http://blog.promethe.net/2008/09/22/directflex-work-with-nintendo-64-3d-models/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 11:56:55 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[DirectFlex]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=177</guid>
		<description><![CDATA[I was recently trying a few good old Nintendo 64 games on my eee-pc when I had the idea to try to import some characters to display them in Flash with DirectFlex. I'm not going to explain the full procedure here but simply show a proof of concept. Here it is, the"adult" Link character from [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I was recently trying a few good old Nintendo 64 games on my eee-pc when I had the idea to try to import some characters to display them in Flash with DirectFlex. I'm not going to explain the full procedure here but simply show a proof of concept. Here it is, the"adult" Link character from "Zelda : Ocarina of Time" :</p>
<p style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/09/directflex_n64_link_1.jpg" rel="shadowbox[post-177];player=img;"><img src="http://blog.promethe.net/wp-content/uploads/2008/09/directflex_n64_link_1-300x206.jpg" alt="" title="directflex_n64_link_1" width="300" height="206" class="aligncenter size-medium wp-image-199" /></a></p>
<p><span id="more-177"></span></p>
<p style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/09/directflex_n64_link_3.jpg" rel="shadowbox[post-177];player=img;"><img class="size-medium wp-image-178 aligncenter" title="directflex_n64_link_3" src="http://blog.promethe.net/wp-content/uploads/2008/09/directflex_n64_link_3-300x205.jpg" alt="" width="300" height="205" /></a></p>
<p style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/09/directflex_n64_link_2.jpg" rel="shadowbox[post-177];player=img;"><img class="size-medium wp-image-180 aligncenter" title="directflex_n64_link_2" src="http://blog.promethe.net/wp-content/uploads/2008/09/directflex_n64_link_2-300x205.jpg" alt="" width="300" height="205" /></a></p>
<p style="text-align: justify;">The Link 3D model was extracted from the Nintendo 64 "Zelda : Ocarina of Time" rom then converted into 3DS format and finally converted into DirectFlex 3D models file format (3DS files support is still a work in progress). The DirectFlex library I used here is still the old Flash 9 compatible one.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2008/09/22/directflex-work-with-nintendo-64-3d-models/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>DirectFlex and Flash 10 : what&#8217;s next ?</title>
		<link>http://blog.promethe.net/2008/08/26/directflex-and-flash-10-whats-next/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=directflex-and-flash-10-whats-next</link>
		<comments>http://blog.promethe.net/2008/08/26/directflex-and-flash-10-whats-next/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 22:59:41 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[DirectFlex]]></category>
		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=78</guid>
		<description><![CDATA[My first post was about the 3D Flash library I'm currently working on : DirectFlex. As I said, it is not a simple 3D engine but a full 3D API like DirectX or OpenGL. As Flash 10 is likely to be available when the first public version of DirectFlex will be released, I decided to [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/08/dflex_logo_2_400x400.png" rel="shadowbox[post-78];player=img;"><img class="size-thumbnail wp-image-14 aligncenter" title="dflex_logo_2_400x400" src="http://blog.promethe.net/wp-content/uploads/2008/08/dflex_logo_2_400x400-150x150.png" alt="" width="150" height="150" /></a></p>
<p style="text-align: justify;">My first post was about the 3D Flash library I'm currently working on : DirectFlex. As I said, it is not a simple 3D engine but a full 3D API like DirectX or OpenGL. As Flash 10 is likely to be available when the first public version of DirectFlex will be released, I decided to rewrite the API's core to take advantage of the new 3D mathematics classes and the hardware acceleration features. This is actually the third time that DirectFlex is entirely rewritten from scratch... but time after time the quality of the work and the performances have improved a lot.</p>
<p><span id="more-78"></span></p>
<p style="text-align: justify;"><strong>DirectFlex and the good old Flash 9 ...</strong></p>
<p style="text-align: justify;">DirectFlex' developpement started more than a year ago and it was designed to be used in Flash 9. It's first "correct" rendering was a wireframe spinning cube. One year later, it's last Flash 9 version was able to draw up to 3 000 polygons at 20 frames per second.</p>
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/08/directflex_cs16_gign.png" rel="shadowbox[post-78];player=img;"><img class="size-medium wp-image-79 aligncenter" title="directflex_cs16_gign" src="http://blog.promethe.net/wp-content/uploads/2008/08/directflex_cs16_gign-300x210.png" alt="" width="300" height="210" /></a></p>
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">Here is a screenshot of a flat-shaded 3D model loaded and displayed with DirectFlex. This mesh was actually extracted from Counter Strike 1.6 and is the 3D model of the GIGN skin. With 3000 polygons you can draw this very 3D mesh up to 7 times.</p>
<p style="text-align: justify;">As you can see on the screenshot, the framerate is about 23 frames per second. It's not much, but it is enough to be perfectly smooth inside the Flash player. I could do some ActionScript magic to get a 30 frames per second framerate but that would require a lot more CPU. The most important thing is to get a smooth display without draining to much CPU, and that's exactly what we have here.</p>
<p style="text-align: justify;">Here are two extra screenshots :</p>
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: justify;">
<p style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/08/directflex_m16.png" rel="shadowbox[post-78];player=img;"><img class="size-medium wp-image-80 aligncenter" title="directflex_m16" src="http://blog.promethe.net/wp-content/uploads/2008/08/directflex_m16-300x210.png" alt="" width="300" height="210" /></a></p>
<p style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/08/directflex_spaceship.png" rel="shadowbox[post-78];player=img;"><img class="size-medium wp-image-81 aligncenter" title="directflex_spaceship" src="http://blog.promethe.net/wp-content/uploads/2008/08/directflex_spaceship-300x210.png" alt="" width="300" height="210" /></a></p>
<p style="text-align: justify;"><span style="color: #ff0000;">Please keep in my mind that those screenshots come from the "old" Flash 9 version of DirectFlex. A lot of changes have been made since.</span> However, those screenshots are a good apetizer... and there is a lot more to come with the new Flash 10 version. As you might have understand, my main objective is to  make sure the "basic stuff" runs as fast as possible. Then some fancy effects will be added...</p>
<p style="text-align: justify;">
<p style="text-align: justify;"><strong>So what's new with Flash 10 (doctor) ?</strong></p>
<p style="text-align: justify;">Well the drawing API is a bit faster, and DirectFlex can now draw something like 5 000 polygons at 20 frames per second at least without any hardware acceleration. In fact, hardware acceleration in Flash 10 is still tricky and I didn't manage to enable it for now. Flash 10 is still in beta and is a work in progress. Performances are not stable yet and it is pretty hard to make a good guess about the final release capabilities.</p>
<p style="text-align: justify;">Still, I've been running some tests and Flash 10  seams to be capable to compute up to 50 000 vertices. As you can make at least 16 000 polygons with those 50 000 vertices, it is indeed very frustrating to be able to draw "only" 5 000 of them in the end. Now that Flash 10 has a powerful 3D mathematics API, the drawing API seams to be the real bottleneck but I guess hardware acceleration will make it (a lot) faster.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2008/08/26/directflex-and-flash-10-whats-next/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DirectFlex : a new Flash 10 3D API</title>
		<link>http://blog.promethe.net/2008/08/21/directflex-flash-10-3d-api/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=directflex-flash-10-3d-api</link>
		<comments>http://blog.promethe.net/2008/08/21/directflex-flash-10-3d-api/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 15:46:18 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[DirectFlex]]></category>
		<category><![CDATA[Flash 10]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=15</guid>
		<description><![CDATA[The next version of the Flash player will introduce a lot of new cool/useful features. One of them is the brand new 3D API. Of course, a lot of people are talking about the cool new "3D effects" that use this 3D API, but in the end those do not allow "real" and "complex" 3D [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">The next version of the Flash player will introduce a lot of new cool/useful features. One of them is the brand new 3D API. Of course, a lot of people are talking about the cool new "3D effects" that use this 3D API, but in the end those do not allow "real" and "complex" 3D such as real-time 3D games. So basically, yeah, drawing 3D spinning planes is "cool", but that's not how you're gonna create some "ass-kicking" RIA...</p>
<p style="text-align: justify;">In order to render complex 3D geometry, you'll have to use the underneath 3D API itself. This 3D API is mainly about three classes : Matrix3D, Vector3D and Utils3D. Those implements data types and methods to transform vertices data from a space to another in order to render actual 3D geometry on our very 2d flat screens. And... that's it. We also have the new "Graphics.drawTriangles" method and hardware acceleration, but all of this does not provide what we could call a user-friendly 3D API. But here comes...</p>
<p style="text-align: justify;">
<div class="mceTemp mceIEcenter"><a href="http://blog.promethe.net/wp-content/uploads/2008/08/dflex_logo_2_400x400.png" rel="shadowbox[post-15];player=img;"></a></div>
<div class="mceTemp mceIEcenter" style="text-align: center;"><a href="http://blog.promethe.net/wp-content/uploads/2008/08/dflex_logo_2_400x400.png" rel="shadowbox[post-15];player=img;"><img class="aligncenter size-thumbnail wp-image-14" title="dflex_logo_2_400x400" src="http://blog.promethe.net/wp-content/uploads/2008/08/dflex_logo_2_400x400-150x150.png" alt="" width="150" height="150" /></a></div>
<p><span id="more-15"></span></p>
<p style="text-align: justify;">DirectFlex is a "real" 3D API that uses the low level Flash 10 3D API to make it look and behave like any other 3D API such as DirectX or OpenGL. DirectFlex implementation and prototyping have actually a lot in common with Mirosoft's DirectX. A lot of concepts and programing techniques of DirectX can be found in DirectFlex. It means that most of the DirectX resources such as tutorials and samples will be relevant and will provide a lot of help to DirectFlex users.</p>
<p style="text-align: justify;">The main difference between DirectFlex and any other third party 3D flash librairy is the simple fact that DirectFlex actually <strong>is</strong> a 3D API, and not some kind of a "fake" 3D engine. It means that you can work at the lowest level just like you would do it with DirectX or OpenGL : you have a total control on mathematics, algorithms and vertices/primitives data.</p>
<p style="text-align: justify;">DirectFlex core takes care of most of the 3D rendering issues such as mathematics, z-sorting, mapping, and more. Although, because DirectX programming is not something any flash developer can handle, DirectFlex also includes a fully functional 3D engine and a 3D stage that mimics the behavior of the 2D stage of ActionScript 3.0.</p>
<p>Some demo applications, screenshots and a developers's blog will be released... "when it's done" <img src='http://blog.promethe.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2008/08/21/directflex-flash-10-3d-api/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
