<?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>Floorplanner Tech Blog &#187; Papervision3D</title>
	<atom:link href="http://techblog.floorplanner.com/category/papervision/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.floorplanner.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 19 Nov 2009 04:00:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Papervision3D 2.1 &#8211; alpha</title>
		<link>http://techblog.floorplanner.com/2009/05/26/papervision3d-21-alpha/</link>
		<comments>http://techblog.floorplanner.com/2009/05/26/papervision3d-21-alpha/#comments</comments>
		<pubDate>Tue, 26 May 2009 20:57:53 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=659</guid>
		<description><![CDATA[Just committed rev. 911 to the Papervision3D SVN trunk. Rev. 911 and upwards will become Papervision3D 2.1 because the changes made are quite big.
Major changes where made to the DAE, MD2 and animation classes.
NOTE:
This revision is considerably different then previous revisions. Use with care!
At this point its not advised to use rev. 911 for production.
This [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2009%2F05%2F26%2Fpapervision3d-21-alpha%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2009%2F05%2F26%2Fpapervision3d-21-alpha%2F" height="61" width="51" /></a></div><p>Just committed rev. 911 to the <a href="http://code.google.com/p/papervision3d/">Papervision3D SVN trunk</a>. Rev. 911 and upwards will become Papervision3D 2.1 because the changes made are quite big.<br />
Major changes where made to the DAE, MD2 and animation classes.</p>
<p>NOTE:<br />
This revision is considerably different then previous revisions. Use with care!<br />
At this point its not advised to use rev. 911 for production.</p>
<p>This revision fixes several issues regarding the <a href="http://code.google.com/p/papervision3d/source/browse/trunk/as3/trunk/src/org/papervision3d/objects/parsers/DAE.as?r=911">DAE class</a>:</p>
<ol>
<li>vertex-animation</li>
<li>nested animations</li>
<li>Cinema4D support</li>
<li>morph-weight animation</li>
<li>splines</li>
<li>cloning</li>
<li>play(), play(&#8221;clipName&#8221;), stop(), pause(), resume()</li>
<li>more&#8230;</li>
</ol>
<p>The whole <a href="http://code.google.com/p/papervision3d/source/browse/trunk/as3/trunk/src/org/papervision3d/?r=911#papervision3d/core/animation">org.papervision3d.core.animation.*</a> package has been revamped <strong>completely</strong> to allow for the changes in the <a href="http://code.google.com/p/papervision3d/source/browse/trunk/as3/trunk/src/org/papervision3d/objects/parsers/DAE.as?r=911">DAE class</a>.</p>
<p><strong>DAE Example</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family: Monaco,monospace;"><span style="color: #000000; font-weight: bold;">var</span> autoPlay : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>; <span style="color: #808080; font-style: italic;">// don't play animations automatically</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> dae : DAE = <span style="color: #000000; font-weight: bold;">new</span> DAE<span style="color: #66cc66;">&#40;</span> autoPlay, <span style="color: #ff0000;">&quot;myCollada&quot;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
dae.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>FileLoadEvent.<span style="color: #006600;">LOAD_COMPLETE</span>, onDaeComplete<span style="color: #66cc66;">&#41;</span>;
dae.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>FileLoadEvent.<span style="color: #006600;">LOAD_PROGRESS</span>, onDaeLoadProgress<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// optionally pass materials to DAE</span>
<span style="color: #808080; font-style: italic;">// NOTE: here's a change with previous revs :</span>
<span style="color: #808080; font-style: italic;">// 1. lookup the &lt;material&gt; elements in the COLLADA file (inside &lt;library_materials&gt;).</span>
<span style="color: #808080; font-style: italic;">// 2. write down / remember the @id attribute of the &lt;material&gt; element.</span>
<span style="color: #808080; font-style: italic;">// 3. materials.addMaterial( myMaterial, materialElementID ).</span>
<span style="color: #808080; font-style: italic;">// ==&gt; this will probably change in future revs</span>
<span style="color: #000000; font-weight: bold;">var</span> materials : MaterialsList = <span style="color: #000000; font-weight: bold;">new</span> MaterialsList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// If textures fail to load optionally add some search-paths </span>
<span style="color: #808080; font-style: italic;">// (relative to the swf):</span>
dae.<span style="color: #006600;">addFileSearchPath</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;images&quot;</span> <span style="color: #66cc66;">&#41;</span>;
dae.<span style="color: #006600;">addFileSearchPath</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;textures&quot;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// set to true if you get a script-timeout error</span>
<span style="color: #000000; font-weight: bold;">var</span> asyncParsing : <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// load it!</span>
dae.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;/path/to/dae&quot;</span>, materials, asyncParsing <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * The DAE has loaded completely
 */</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onDaeComplete<span style="color: #66cc66;">&#40;</span>event : FileLoadEvent<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">var</span> dae : DAE = event.<span style="color: #0066CC;">target</span> as DAE;
&nbsp;
     <span style="color: #808080; font-style: italic;">// add to scene</span>
     scene.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> dae <span style="color: #66cc66;">&#41;</span>;
&nbsp;
     <span style="color: #808080; font-style: italic;">// start playing animation (if any available)</span>
     <span style="color: #808080; font-style: italic;">// other animation controls include :</span>
     <span style="color: #808080; font-style: italic;">// 1. play( &quot;clipName &quot;)</span>
     <span style="color: #808080; font-style: italic;">// 2. stop()</span>
     <span style="color: #808080; font-style: italic;">// 3. pause()</span>
     <span style="color: #808080; font-style: italic;">// 4. resume()</span>
     <span style="color: #808080; font-style: italic;">// 5. playing (getter: bool indicating if playing)</span>
     dae.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
     <span style="color: #808080; font-style: italic;">// lets create a clone</span>
     <span style="color: #808080; font-style: italic;">// NOTE: DAE#clone() is somewhat bugged still, </span>
     <span style="color: #808080; font-style: italic;">// but seems to work in most cases</span>
     <span style="color: #000000; font-weight: bold;">var</span> clone : DAE = dae.<span style="color: #006600;">clone</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> as DAE;
&nbsp;
     <span style="color: #808080; font-style: italic;">// add clone to scene</span>
     scene.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span> clone <span style="color: #66cc66;">&#41;</span>;
&nbsp;
     <span style="color: #808080; font-style: italic;">// move it a bit</span>
     clone.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">200</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onDaeLoadProgress<span style="color: #66cc66;">&#40;</span>event : FileLoadEvent<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><strong>MD2 Example</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family: Monaco,monospace;"><span style="color: #000000; font-weight: bold;">var</span> md2 : MD2 = <span style="color: #000000; font-weight: bold;">new</span> MD2<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> material : MaterialObject3D = <span style="color: #000000; font-weight: bold;">new</span> WireframeMaterial<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
md2.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>FileLoadEvent.<span style="color: #006600;">LOAD_COMPLETE</span>, onMD2Complete<span style="color: #66cc66;">&#41;</span>;
&nbsp;
md2.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;/path/to/md2&quot;</span>, material<span style="color: #66cc66;">&#41;</span>;
&nbsp;
scene.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>md2<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onMD2Complete<span style="color: #66cc66;">&#40;</span>event : FileLoadEvent<span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
       <span style="color: #000000; font-weight: bold;">var</span> md2 : MD2 = event.<span style="color: #0066CC;">target</span> as MD2;
&nbsp;
       md2.<span style="color: #0066CC;">play</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
       <span style="color: #808080; font-style: italic;">// or play some clip :</span>
       <span style="color: #808080; font-style: italic;">// md2.play( &quot;run&quot; )</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><strong>Animation</strong>:</p>
<p>Click the image below to show an example of the new animation controls.<br />
<a href="http://lab.floorplanner.com/pv3d/21/animation/"><img src="http://techblog.floorplanner.com/wp-content/uploads/2009/05/picture-3.png" alt="Animation Test" title="Animation Test" width="511" height="371" class="alignnone size-full wp-image-686" /></a><br />
Download the source of this example <a href="http://lab.floorplanner.com/pv3d/21/animation/AnimationTest.as">here</a>.</p>
<p>The DAE and MD2 class implement <a href="http://code.google.com/p/papervision3d/source/browse/trunk/as3/trunk/src/org/papervision3d/core/animation/IAnimatable.as">IAnimatable</a>, <a href="http://code.google.com/p/papervision3d/source/browse/trunk/as3/trunk/src/org/papervision3d/core/animation/IAnimationProvider.as">IAnimationProvider</a> and <a href="http://code.google.com/p/papervision3d/source/browse/trunk/as3/trunk/src/org/papervision3d/core/controller/IControllerProvider.as">IControllerProvider</a>, which can be found in the org.papervision3d.core.animation.* package.</p>
<ul>
<li>IAnimatable provides the play(), stop(), pause() and resume() methods.</li>
<li>IAnimationProvider provides a getter / setter #animation for low level access to <a href="http://code.google.com/p/papervision3d/source/browse/trunk/as3/trunk/src/org/papervision3d/core/controller/AnimationController.as">org.papervision3d.core.controllers.AnimationController</a></li>
<li>IControllerProvider provides a getter / setter #controllers for low level access to the different controllers:
<ul>
<li><a href="http://code.google.com/p/papervision3d/source/browse/trunk/as3/trunk/src/org/papervision3d/core/controller/MorphController.as">org.papervision3d.core.controllers.MorphController</a></li>
<li><a href="http://code.google.com/p/papervision3d/source/browse/trunk/as3/trunk/src/org/papervision3d/core/controller/SkinController.as">org.papervision3d.core.controllers.SkinController</a></li>
<li><a href="http://code.google.com/p/papervision3d/source/browse/trunk/as3/trunk/src/org/papervision3d/core/controller/AnimationController.as">org.papervision3d.core.controllers.AnimationController</a></li>
</ul>
</li>
</ul>
<p>As so much has changed I&#8217;m sure some bugs are introduced. Please let me know!</p>
<p>PS: I&#8217;ll be on vacation until june 8th, so its unlikely I&#8217;ll be able to fix any bugs before that time.<br />
PS2: Many people have helped by submitting code-snips, reporting bugs etc. I&#8217;ll credit you all when I&#8217;m back <img src='http://techblog.floorplanner.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2009/05/26/papervision3d-21-alpha/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Unproject with useProjectionMatrix = true</title>
		<link>http://techblog.floorplanner.com/2009/04/29/unproject-with-useprojectionmatrix-true/</link>
		<comments>http://techblog.floorplanner.com/2009/04/29/unproject-with-useprojectionmatrix-true/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 00:45:40 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Collaboration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Floorplanner]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[unproject]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=580</guid>
		<description><![CDATA[I just updated Papervision3D to allow the CameraObject3D#unproject method to work when CameraObject3D#useProjectionMatrix = true.
Papervision3D has two methods of &#8216;projecting&#8217; vectors onto the screen:

useProjectionMatrix = false, this is the default &#8216;fast&#8217; method
useProjectionMatrix = true, this is the method where projection is done by a matrix

Note that Papervision3D switches to method #2 in &#8216;ortho mode&#8217;.
So what [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2009%2F04%2F29%2Funproject-with-useprojectionmatrix-true%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2009%2F04%2F29%2Funproject-with-useprojectionmatrix-true%2F" height="61" width="51" /></a></div><p>I just updated <a href="http://blog.papervision3d.org">Papervision3D</a> to allow the CameraObject3D#unproject method to work when CameraObject3D#useProjectionMatrix = true.</p>
<p>Papervision3D has two methods of &#8216;projecting&#8217; vectors onto the screen:</p>
<ol>
<li>useProjectionMatrix = false, this is the default &#8216;fast&#8217; method</li>
<li>useProjectionMatrix = true, this is the method where projection is done by a matrix</li>
</ol>
<p>Note that Papervision3D switches to method #2 in &#8216;ortho mode&#8217;.</p>
<p>So what is the difference exactly between these two kinds of projection? First we need to define what projection is. Projection is what adds &#8216;perspective&#8217; to a scene and makes sure your scene fits to the viewport. Its the last step in the so-called &#8216;render pipeline&#8217;. </p>
<p>We can derive the &#8216;fore shortening&#8217; effect of perspective in several ways. Method #1 is simple, effective and fast. It uses the camera&#8217;s focus and zoom values. Method #2 uses a more classic way of projection : it uses a dedicated matrix. Tech buffs: very much like OpenGL&#8217;s <a href="http://www.opengl.org/sdk/docs/man/xhtml/gluPerspective.xml">gluPerspective</a>.</p>
<p><a href="http://blog.zupko.info/">Andy Zupko</a> has a great <a href="http://blog.zupko.info/?p=143">post</a> on unproject using method #1.</p>
<p>We will discuss unproject using method #2, which works slightly different.</p>
<p>The difference is that when #useProjectionMatrix is set to true, then CameraObject3D#unproject  returns a point in world-space, rather then a ray. Let me explain with some code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="actionscript3" style="font-family: Monaco,monospace;"><span style="color: #009900;">// we want to use a projection matrix</span>
camera.useProjectionMatrix = <span style="color: #0033ff; font-weight: bold;">true</span>;
&nbsp;
<span style="color: #009900;">// '0' indicates we want a point on the near plane</span>
<span style="color: #6699cc; font-weight: bold;">var</span> pointOnNearPlane <span style="color: #000000; font-weight: bold;">:</span> Number3D = camera.unproject<span style="color: #000000;">&#40;</span> screenX, screenY, <span style="color: #000000; font-weight:bold;">0</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #009900;">// '1' indicates we want a point on the far plane</span>
<span style="color: #6699cc; font-weight: bold;">var</span> pointOnFarPlane <span style="color: #000000; font-weight: bold;">:</span> Number3D = camera.unproject<span style="color: #000000;">&#40;</span> screenX, screenY, <span style="color: #000000; font-weight:bold;">1</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #009900;">// Construct the ray's direction</span>
<span style="color: #6699cc; font-weight: bold;">var</span> dir <span style="color: #000000; font-weight: bold;">:</span> Number3D = Number3D.sub<span style="color: #000000;">&#40;</span> pointOnFarPlane, pointOnNearPlane <span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #009900;">// Normalize</span>
dir.<span style="color: #004993;">normalize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #009900;">// So, now you have a ray with its origin at 'pointOnNearPlane',</span>
<span style="color: #009900;">// and direction 'dir'</span></pre></td></tr></table></div>

<p>Optimization: could save some cycles by doing (*not* in ortho mode!, see below):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="actionscript3" style="font-family: Monaco,monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> camPosition <span style="color: #000000; font-weight: bold;">:</span> Number3D = <span style="color: #0033ff; font-weight: bold;">new</span> Number3D<span style="color: #000000;">&#40;</span> camera.<span style="color: #004993;">x</span>, camera.<span style="color: #004993;">y</span>, camera.z <span style="color: #000000;">&#41;</span>;
<span style="color: #009900;">// Construct the ray's direction</span>
<span style="color: #6699cc; font-weight: bold;">var</span> dir <span style="color: #000000; font-weight: bold;">:</span> Number3D = Number3D.sub<span style="color: #000000;">&#40;</span> pointOnFarPlane, camPosition <span style="color: #000000;">&#41;</span>;
<span style="color: #009900;">// Normalize</span>
dir.<span style="color: #004993;">normalize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #009900;">// So, now you have a ray with its origin at the camera's position</span>
<span style="color: #009900;">// and direction 'dir'</span></pre></td></tr></table></div>

<p>Why can&#8217;t we use above optimization in ortho mode?<br />
In perspective mode all &#8216;rays&#8217; originate from the camera&#8217;s position: the &#8216;view cone&#8217; has shape of a pyramid. Hence we can assume &#8216;pointOnNearPlane&#8217; to coincide with the camera&#8217;s position.<br />
In ortho mode however the &#8216;view cone&#8217; has the shape of a cube, all rays are parallel. Hence we need to unproject *two* points to construct our ray.</p>
<p>Now simply follow <a href="http://blog.zupko.info/?p=143">Andy Zupko &#8217;s post</a> to drag objects around.<br />
Or perform &#8216;picking&#8217;, or&#8230;</p>
<p>Update:<br />
Created a little demo to visualize what I&#8217;m ranting about, check it out <a href='http://techblog.floorplanner.com/wp-content/uploads/2009/04/unprojecttest1.swf'>here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2009/04/29/unproject-with-useprojectionmatrix-true/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Papervision3D forum</title>
		<link>http://techblog.floorplanner.com/2009/01/20/papervision3d-forum/</link>
		<comments>http://techblog.floorplanner.com/2009/01/20/papervision3d-forum/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 15:45:34 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Floorplanner]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[forum]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=415</guid>
		<description><![CDATA[On request of many: Papervision3D now has a forum : http://forum.papervision3d.org/
Read more at the Papervision3D blog.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2009%2F01%2F20%2Fpapervision3d-forum%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2009%2F01%2F20%2Fpapervision3d-forum%2F" height="61" width="51" /></a></div><p>On request of many: Papervision3D now has a forum : http://forum.papervision3d.org/</p>
<p>Read more at the <a href="http://blog.papervision3d.org/2009/01/19/forumpapervision3dorg/">Papervision3D blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2009/01/20/papervision3d-forum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papervision3D wins Innovation Of The Year award</title>
		<link>http://techblog.floorplanner.com/2008/12/09/papervision3d-wins-innovation-of-the-year-award/</link>
		<comments>http://techblog.floorplanner.com/2008/12/09/papervision3d-wins-innovation-of-the-year-award/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 20:15:17 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Floorplanner]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[award]]></category>
		<category><![CDATA[papervisi]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=309</guid>
		<description><![CDATA[Papervision3D has won the INNOVATION OF THE YEAR in this year’s .net Awards!
Other nominees included Google Android and App Engine, Microsoft Telescope, Open Social and Silverlight 2. I&#8217;m very proud to be part of the Papervision3D team!

Read more on the Papervision3D blog.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2008%2F12%2F09%2Fpapervision3d-wins-innovation-of-the-year-award%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2008%2F12%2F09%2Fpapervision3d-wins-innovation-of-the-year-award%2F" height="61" width="51" /></a></div><p>Papervision3D has won the INNOVATION OF THE YEAR in this year’s <a href="http://www.thenetawards.com/">.net Awards</a>!<br />
Other nominees included Google Android and App Engine, Microsoft Telescope, Open Social and Silverlight 2. I&#8217;m very proud to be part of the Papervision3D team!</p>
<p><img title="dotnet innovation award 2008" src="http://papervision3d.files.wordpress.com/2008/12/web_rgb_logo2.gif?w=240&amp;h=198" alt="dotnet innovation award 2008" width="240" height="198" /></p>
<p>Read more on the <a href="http://blog.papervision3d.org/2008/12/09/innovation-of-the-year/">Papervision3D blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2008/12/09/papervision3d-wins-innovation-of-the-year-award/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Alchemy &#8211; first looks</title>
		<link>http://techblog.floorplanner.com/2008/11/23/alchemy-first-looks/</link>
		<comments>http://techblog.floorplanner.com/2008/11/23/alchemy-first-looks/#comments</comments>
		<pubDate>Sun, 23 Nov 2008 15:30:26 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Floorplanner]]></category>
		<category><![CDATA[Papervision3D]]></category>
		<category><![CDATA[alchemy flash as3 swc triangulation]]></category>

		<guid isPermaLink="false">http://techblog.floorplanner.com/?p=261</guid>
		<description><![CDATA[Adobe has recently released a preview version of Alchemy. From their site:
Welcome the preview release of codename &#8220;Alchemy.&#8221; Alchemy is a research project that allows users to compile C and C++ code that is targeted to run on the open source ActionScript Virtual Machine (AVM2). The purpose of this preview is to assess the level [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2008%2F11%2F23%2Falchemy-first-looks%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2008%2F11%2F23%2Falchemy-first-looks%2F" height="61" width="51" /></a></div><p>Adobe has recently released a preview version of <a href="http://labs.adobe.com/technologies/alchemy/">Alchemy</a>. From their site:</p>
<blockquote><p>Welcome the preview release of codename &#8220;Alchemy.&#8221; Alchemy is a research project that allows users to compile C and C++ code that is targeted to run on the open source ActionScript Virtual Machine (AVM2). The purpose of this preview is to assess the level of community interest in reusing existing C and C++ libraries in Web applications that run on Adobe® Flash® Player and Adobe AIR®.</p></blockquote>
<p>So, what does this mean? This means that we can use existing C/C++ code and compile that down to AS3. Initially I though that this implied a hefty increase in code execution speed, but as all is compiled down to AS3 this is <strong>not</strong> true in most cases. Code will only run faster if you &#8217;stay&#8217; on the C-side and only return to &#8216;AS3&#8242; when your C code is done processing. The reason is that AS3 method-calls are sloooow (params need to be &#8216;unboxed&#8217; etc.)! When in C this slowness doesn&#8217;t occur and hence execution speed will be faster (Adobe claims a potential speed increase by a factor 2 to 10 I beleive). Wow! That of course made me wonder whether Alchemy would be usefull for 3D engines like Papervision3D, more soon! <img src='http://techblog.floorplanner.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://www.automatastudios.com">Branden Hall</a> did a nice <a href="http://www.automatastudios.com/2008/11/21/understanding-adobe-alchemy/">writeup</a> on Alchemy explaining above better then me.</p>
<p>I couldn&#8217;t resist myself and started off immediately with something I always wanted to code for our 3D engine: <a href="http://en.wikipedia.org/wiki/Polygon_triangulation">Polygon Triangulation</a> with support for holes.</p>
<p>I installed the <a href="http://labs.adobe.com/downloads/alchemy.html">Alchemy Toolkit</a>, got the Flex 3.2 SDK and got some C code from the <a href="http://www.cs.unc.edu/~dm/CODE/GEM/chapter.html">Department of Computer Science, UNC Chapel Hill</a>.</p>
<p>Setting up the toolkit was bit tricky, but with help from <a href="http://labs.adobe.com/wiki/index.php/Alchemy:Documentation:Getting_Started">this page</a> I finally succeeded to get my environment right (OSX). Then I hit &#8216;make&#8217; and presto! Got my swc! <a href="http://www.assembla.com/spaces/floorplanner-alchemy/documents">Download the swc and sample code</a> or <a href="http://www.assembla.com/spaces/floorplanner-alchemy/documents/agZ5W8Uxir3y-mab7jnrAJ/download/TriangulationTest.swf">view a live example</a>.</p>
<p>Some notes on swc usage:<br />
1] &#8216;outer&#8217; polygons must be defined anti-clockwise<br />
2] &#8216;inner&#8217; polygons (holes) must be defined clock-wise</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="actionscript3" style="font-family: Monaco,monospace;"><span style="color: #009900;">// import</span>
<span style="color: #0033ff; font-weight: bold;">import</span> cmodule.triangulation.CLibInit;
&nbsp;
<span style="color: #009900;">// initialize</span>
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span><span style="color: #000000; font-weight: bold;">:</span>CLibInit = <span style="color: #0033ff; font-weight: bold;">new</span> CLibInit;
<span style="color: #6699cc; font-weight: bold;">var</span> lib<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span> = <span style="color: #004993;">loader</span>.<span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #009900;">// @vertices is an array of XY-pairs: [ [], [x0, y0], [x1, y1], ...]</span>
<span style="color: #009900;">//                NOTE: @vertices[0] should always be [] </span>
<span style="color: #009900;">// @contours is an array containing the number of points of each polygon</span>
<span style="color: #009900;">//                =&gt; [4, 3, 3, 3] indicates 4 polygons with the first poly having 4 points, the second 3, etc.</span>
<span style="color: #009900;">// @ncontours is the number of polygons (in our example: 4)</span>
<span style="color: #009900;">//</span>
<span style="color: #009900;">// @return An array of indices into the vertices array in form: [ [p0, p1, p2], [p0, p1, p2], ...]</span>
<span style="color: #6699cc; font-weight: bold;">var</span> indices <span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Array</span> = lib.triangulate<span style="color: #000000;">&#40;</span> vertices, contours, ncontours <span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>Here&#8217;s the relevant C code which was simply added to tri.c :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
</pre></td><td class="code"><pre class="c" style="font-family: Monaco,monospace;"><span style="color: #993333;">static</span> AS3_Val triangulate<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #339933;">*</span> self<span style="color: #339933;">,</span> AS3_Val args<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> ncontours <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> ccount<span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> npoints<span style="color: #339933;">,</span> first<span style="color: #339933;">,</span> last<span style="color: #339933;">,</span> n<span style="color: #339933;">,</span> nmonpoly<span style="color: #339933;">;</span>
	<span style="color: #993333;">register</span> <span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> op<span style="color: #009900;">&#91;</span>SEGSIZE<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> ntriangles<span style="color: #339933;">;</span>
	AS3_Val dataVal<span style="color: #339933;">;</span>
	AS3_Val contourVal<span style="color: #339933;">;</span>
	AS3_Val retVal<span style="color: #339933;">;</span>
	AS3_Val temp<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* initialze the AS3 values */</span>
	dataVal <span style="color: #339933;">=</span> AS3_Undefined<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	contourVal <span style="color: #339933;">=</span> AS3_Undefined<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	retVal <span style="color: #339933;">=</span> AS3_Undefined<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	temp <span style="color: #339933;">=</span> AS3_Undefined<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//parse the arguments.</span>
	AS3_ArrayValue<span style="color: #009900;">&#40;</span> args<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;AS3ValType, AS3ValType, IntType&quot;</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>dataVal<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>contourVal<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>ncontours <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//if no argument is specified</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>dataVal <span style="color: #339933;">==</span> NULL <span style="color: #339933;">||</span> contourVal <span style="color: #339933;">==</span> NULL <span style="color: #339933;">||</span> ncontours <span style="color: #339933;">&lt;=</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		AS3_Trace<span style="color: #009900;">&#40;</span> AS3_String<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Invalid input data!&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> AS3_Null<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	ccount <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	i <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>ccount <span style="color: #339933;">&lt;</span> ncontours<span style="color: #009900;">&#41;</span>
   	<span style="color: #009900;">&#123;</span>
		<span style="color: #993333;">int</span> j<span style="color: #339933;">;</span>
		<span style="color: #993333;">int</span> k<span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//fscanf(infile, &quot;%d&quot;, &amp;npoints);</span>
&nbsp;
		npoints <span style="color: #339933;">=</span> AS3_IntValue<span style="color: #009900;">&#40;</span> AS3_Get<span style="color: #009900;">&#40;</span>contourVal<span style="color: #339933;">,</span> AS3_Int<span style="color: #009900;">&#40;</span>ccount<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		first <span style="color: #339933;">=</span> i<span style="color: #339933;">;</span>
		last <span style="color: #339933;">=</span> first <span style="color: #339933;">+</span> npoints <span style="color: #339933;">-</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>j <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> k <span style="color: #339933;">=</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&lt;</span> npoints<span style="color: #339933;">;</span> j<span style="color: #339933;">++,</span> i<span style="color: #339933;">++,</span> k <span style="color: #339933;">+=</span> <span style="color: #0000dd;">2</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">//fscanf(infile, &quot;%lf%lf&quot;, &amp;seg[i].v0.x, &amp;seg[i].v0.y);</span>
			temp <span style="color: #339933;">=</span> AS3_Get<span style="color: #009900;">&#40;</span>dataVal<span style="color: #339933;">,</span> AS3_Int<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v0</span>.<span style="color: #202020;">x</span> <span style="color: #339933;">=</span> AS3_NumberValue<span style="color: #009900;">&#40;</span> AS3_Get<span style="color: #009900;">&#40;</span>temp<span style="color: #339933;">,</span> AS3_Int<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v0</span>.<span style="color: #202020;">y</span> <span style="color: #339933;">=</span> AS3_NumberValue<span style="color: #009900;">&#40;</span> AS3_Get<span style="color: #009900;">&#40;</span>temp<span style="color: #339933;">,</span> AS3_Int<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">==</span> last<span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">next</span> <span style="color: #339933;">=</span> first<span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">prev</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v1</span> <span style="color: #339933;">=</span> seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v0</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">==</span> first<span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">next</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">prev</span> <span style="color: #339933;">=</span> last<span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>last<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v1</span> <span style="color: #339933;">=</span> seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v0</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">else</span>
			<span style="color: #009900;">&#123;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">prev</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">next</span> <span style="color: #339933;">=</span> i<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
				seg<span style="color: #009900;">&#91;</span>i<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v1</span> <span style="color: #339933;">=</span> seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">v0</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			seg<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #202020;">is_inserted</span> <span style="color: #339933;">=</span> FALSE<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		ccount<span style="color: #339933;">++;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	n <span style="color: #339933;">=</span> i <span style="color: #339933;">-</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	initialise<span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	construct_trapezoids<span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	nmonpoly <span style="color: #339933;">=</span> monotonate_trapezoids<span style="color: #009900;">&#40;</span>n<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	ntriangles <span style="color: #339933;">=</span> triangulate_monotone_polygons<span style="color: #009900;">&#40;</span>n<span style="color: #339933;">,</span> nmonpoly<span style="color: #339933;">,</span> op<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	retVal <span style="color: #339933;">=</span> AS3_Array<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;AS3ValType&quot;</span><span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> ntriangles<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
   	<span style="color: #009900;">&#123;</span>
		AS3_Val data <span style="color: #339933;">=</span> AS3_Array<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;IntType, IntType, IntType&quot;</span><span style="color: #339933;">,</span> op<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> op<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> op<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		AS3_Set<span style="color: #009900;">&#40;</span>retVal<span style="color: #339933;">,</span> AS3_Int<span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> retVal<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//entry point for code</span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">//define the methods exposed to ActionScript</span>
	<span style="color: #666666; font-style: italic;">//typed as an ActionScript Function instance</span>
	AS3_Val echoMethod <span style="color: #339933;">=</span> AS3_Function<span style="color: #009900;">&#40;</span> NULL<span style="color: #339933;">,</span> echo <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	AS3_Val triMethod <span style="color: #339933;">=</span> AS3_Function<span style="color: #009900;">&#40;</span> NULL<span style="color: #339933;">,</span> triangulate <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// construct an object that holds references to the functions</span>
	AS3_Val result <span style="color: #339933;">=</span> AS3_Object<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;echo: AS3ValType&quot;</span><span style="color: #339933;">,</span> echoMethod <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	AS3_SetS<span style="color: #009900;">&#40;</span>result<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;triangulate&quot;</span><span style="color: #339933;">,</span> triMethod<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Release</span>
	AS3_Release<span style="color: #009900;">&#40;</span> echoMethod <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	AS3_Release<span style="color: #009900;">&#40;</span> triMethod <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// notify that we initialized -- THIS DOES NOT RETURN!</span>
	AS3_LibInit<span style="color: #009900;">&#40;</span> result <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// should never get here!</span>
	<span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2008/11/23/alchemy-first-looks/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Papervision3D &#8211; FrustumCamera3D</title>
		<link>http://techblog.floorplanner.com/2008/02/10/papervision3d-frustumcamera3d/</link>
		<comments>http://techblog.floorplanner.com/2008/02/10/papervision3d-frustumcamera3d/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 15:51:16 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/papervision3d-frustumcamera3d.html</guid>
		<description><![CDATA[Yesterday I updated the FrustumCamera3D class of Papervision3D. Time for a short tutorial on this camera!
The main difference between this camera and the other 2 cameras (Camera3D and FreeCamera3D) is that this camera uses a &#8216;real&#8217; projection matrix, analogue to OpenGL. The FrustumCamera3D has 2 types of projection matrices: perspective and orthographic.
Checkout the example belonging [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2008%2F02%2F10%2Fpapervision3d-frustumcamera3d%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2008%2F02%2F10%2Fpapervision3d-frustumcamera3d%2F" height="61" width="51" /></a></div><p>Yesterday I updated the <a href="http://code.google.com/p/papervision3d/source/browse/trunk/branches/GreatWhite/src/org/papervision3d/cameras/FrustumCamera3D.as">FrustumCamera3D</a> class of <a href="http://blog.papervision3d.org/">Papervision3D</a>. Time for a short tutorial on this camera!</p>
<p>The main difference between this camera and the other 2 cameras (Camera3D and FreeCamera3D) is that this camera uses a &#8216;real&#8217; projection matrix, analogue to OpenGL. The FrustumCamera3D has 2 types of projection matrices: perspective and <a href="http://en.wikipedia.org/wiki/Orthographic_projection">orthographic</a>.</p>
<p><a href="http://www.ascollada.org/tutorials/frustumcamera/">Checkout the example</a> belonging to this tutorial (well: the code below IS the tutorial <img src='http://techblog.floorplanner.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family: Monaco,monospace;">&nbsp;
package <span style="color: #66cc66;">&#123;</span>
&nbsp;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">geom</span>.<span style="color: #006600;">Point</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextField</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #0066CC;">text</span>.<span style="color: #0066CC;">TextFormat</span>;
&nbsp;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">Papervision3D</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">cameras</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">core</span>.<span style="color: #0066CC;">math</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">proto</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">materials</span>.<span style="color: #006600;">utils</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">objects</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">objects</span>.<span style="color: #006600;">primitives</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">render</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">scenes</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">papervision3d</span>.<span style="color: #006600;">view</span>.<span style="color: #66cc66;">*</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * @author timknip
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TutoFrustumCamera3D <span style="color: #0066CC;">extends</span> Sprite <span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/** The PV3D scene to render */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> scene : Scene3D;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** This PV3D camera */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">camera</span> : FrustumCamera3D;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** The PV3D renderer */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> renderer : BasicRenderEngine;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** The PV3D viewport */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> viewport : Viewport3D;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** Show info */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">status</span> : <span style="color: #0066CC;">TextField</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * Constructor.
	 */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> TutoFrustumCamera3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * Init.
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">// add a textfield</span>
		initStatusLine<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// used by orbiting / zooming</span>
		_lastMouse = <span style="color: #000000; font-weight: bold;">new</span> Point<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// create a viewport</span>
		viewport = <span style="color: #000000; font-weight: bold;">new</span> Viewport3D<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">800</span>, <span style="color: #cc66cc;">600</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// add</span>
		addChild<span style="color: #66cc66;">&#40;</span>viewport<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// create a frustum camera with FOV=60, near=10, far=10000</span>
		<span style="color: #0066CC;">camera</span> = <span style="color: #000000; font-weight: bold;">new</span> FrustumCamera3D<span style="color: #66cc66;">&#40;</span>viewport, <span style="color: #cc66cc;">60</span>, <span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">10000</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// create a renderer</span>
		renderer = <span style="color: #000000; font-weight: bold;">new</span> BasicRenderEngine<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// create the scene</span>
		scene = <span style="color: #000000; font-weight: bold;">new</span> Scene3D<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// init the scene</span>
		initScene<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// mouse listeners</span>
		<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, mouseDownHandler<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_MOVE</span>, mouseMoveHandler<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, mouseUpHandler<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// key listener</span>
		<span style="color: #0066CC;">stage</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>KeyboardEvent.<span style="color: #006600;">KEY_UP</span>, keyUpHandler<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// render on each frame</span>
		addEventListener<span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">ENTER_FRAME</span>, render<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		showInfo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * Init the scene.
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> initScene<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">var</span> materials : MaterialsList = <span style="color: #000000; font-weight: bold;">new</span> MaterialsList<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		materials.<span style="color: #006600;">addMaterial</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> WireframeMaterial<span style="color: #66cc66;">&#40;</span>0xff0000<span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;front&quot;</span><span style="color: #66cc66;">&#41;</span>;
		materials.<span style="color: #006600;">addMaterial</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> WireframeMaterial<span style="color: #66cc66;">&#40;</span>0x0000ff<span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;back&quot;</span><span style="color: #66cc66;">&#41;</span>;
		materials.<span style="color: #006600;">addMaterial</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> WireframeMaterial<span style="color: #66cc66;">&#40;</span>0xffff00<span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;left&quot;</span><span style="color: #66cc66;">&#41;</span>;
		materials.<span style="color: #006600;">addMaterial</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> WireframeMaterial<span style="color: #66cc66;">&#40;</span>0x00ffff<span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;right&quot;</span><span style="color: #66cc66;">&#41;</span>;
		materials.<span style="color: #006600;">addMaterial</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> WireframeMaterial<span style="color: #66cc66;">&#40;</span>0x00ff00<span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;top&quot;</span><span style="color: #66cc66;">&#41;</span>;
		materials.<span style="color: #006600;">addMaterial</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> WireframeMaterial<span style="color: #66cc66;">&#40;</span>0xff00ff<span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;bottom&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #000000; font-weight: bold;">var</span> cube : Cube = <span style="color: #000000; font-weight: bold;">new</span> Cube<span style="color: #66cc66;">&#40;</span>materials<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		scene.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>cube<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * Add a textfield.
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> initStatusLine<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">status</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		addChild<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">status</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">status</span>.<span style="color: #006600;">x</span> = <span style="color: #0066CC;">status</span>.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">5</span>;
		<span style="color: #0066CC;">status</span>.<span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;">500</span>;
		<span style="color: #0066CC;">status</span>.<span style="color: #0066CC;">height</span> = <span style="color: #cc66cc;">200</span>;
		<span style="color: #0066CC;">status</span>.<span style="color: #0066CC;">multiline</span> = <span style="color: #000000; font-weight: bold;">true</span>;
		<span style="color: #0066CC;">status</span>.<span style="color: #0066CC;">selectable</span> = <span style="color: #000000; font-weight: bold;">false</span>;
		<span style="color: #0066CC;">status</span>.<span style="color: #006600;">defaultTextFormat</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextFormat</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Arial&quot;</span>, <span style="color: #cc66cc;">12</span>, 0xffff00<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0066CC;">status</span>.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
	 * Render!
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> render<span style="color: #66cc66;">&#40;</span> event : Event = <span style="color: #000000; font-weight: bold;">null</span> <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">// orbit the camera</span>
		<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">orbit</span><span style="color: #66cc66;">&#40;</span>_camTarget, _camPitch, _camYaw, _camDist<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// render</span>
		renderer.<span style="color: #006600;">renderScene</span><span style="color: #66cc66;">&#40;</span>scene, <span style="color: #0066CC;">camera</span>, viewport<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * Show some info;
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> showInfo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> msg : <span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;usage:<span style="color: #000099; font-weight: bold;">\n</span>drag to rotate, drag-shift to zoom<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
		msg += <span style="color: #ff0000;">&quot;- o: toggle ortho / perspective mode<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
		msg += <span style="color: #ff0000;">&quot;- v: increase / decrease(+shift) FOV<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
		msg += <span style="color: #ff0000;">&quot;- f: increase / decrease(+shift) camera far-plane<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
		msg += <span style="color: #ff0000;">&quot;- n: increase / decrease(+shift) camera near-plane<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
		msg += <span style="color: #ff0000;">&quot;camera<span style="color: #000099; font-weight: bold;">\n</span>- projection mode: &quot;</span> + <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">camera</span>.<span style="color: #006600;">ortho</span>?<span style="color: #ff0000;">&quot;ortho&quot;</span>:<span style="color: #ff0000;">&quot;perspective&quot;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
		msg += <span style="color: #ff0000;">&quot;- fov: &quot;</span> + <span style="color: #0066CC;">camera</span>.<span style="color: #006600;">fov</span> + <span style="color: #ff0000;">&quot; near: &quot;</span> + <span style="color: #0066CC;">camera</span>.<span style="color: #006600;">near</span> + <span style="color: #ff0000;">&quot; far: &quot;</span> + <span style="color: #0066CC;">camera</span>.<span style="color: #006600;">far</span> + <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
		<span style="color: #0066CC;">status</span>.<span style="color: #0066CC;">text</span> = msg;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 *
	 * @param	event
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> keyUpHandler<span style="color: #66cc66;">&#40;</span> event : KeyboardEvent <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">keyCode</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">70</span>: <span style="color: #808080; font-style: italic;">// f</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #0066CC;">camera</span>.<span style="color: #006600;">ortho</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">shiftKey</span><span style="color: #66cc66;">&#41;</span>
						<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">far</span> -= <span style="color: #cc66cc;">10</span>;
					<span style="color: #b1b100;">else</span>
						<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">far</span> += <span style="color: #cc66cc;">10</span>;
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #b1b100;">break</span>;
&nbsp;
			<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">78</span>: <span style="color: #808080; font-style: italic;">// n</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #0066CC;">camera</span>.<span style="color: #006600;">ortho</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">shiftKey</span><span style="color: #66cc66;">&#41;</span>
						<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">near</span> -= <span style="color: #cc66cc;">10</span>;
					<span style="color: #b1b100;">else</span>
						<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">near</span> += <span style="color: #cc66cc;">10</span>;
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #b1b100;">break</span>;
&nbsp;
			<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">79</span>: <span style="color: #808080; font-style: italic;">// o</span>
				<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">ortho</span> = <span style="color: #66cc66;">!</span><span style="color: #0066CC;">camera</span>.<span style="color: #006600;">ortho</span>;
				<span style="color: #b1b100;">break</span>;
&nbsp;
			<span style="color: #b1b100;">case</span> <span style="color: #cc66cc;">86</span>: <span style="color: #808080; font-style: italic;">// v</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #0066CC;">camera</span>.<span style="color: #006600;">ortho</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
					<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">shiftKey</span><span style="color: #66cc66;">&#41;</span>
						<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">fov</span> -= <span style="color: #cc66cc;">5</span>;
					<span style="color: #b1b100;">else</span>
						<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">fov</span> += <span style="color: #cc66cc;">5</span>;
				<span style="color: #66cc66;">&#125;</span>
				<span style="color: #b1b100;">break</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">default</span>:
				<span style="color: #b1b100;">break</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		showInfo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 *
	 * @param	event
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> mouseDownHandler<span style="color: #66cc66;">&#40;</span> event : MouseEvent <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		_lastMouse.<span style="color: #006600;">x</span> = event.<span style="color: #006600;">stageX</span>;
		_lastMouse.<span style="color: #006600;">y</span> = event.<span style="color: #006600;">stageY</span>;
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">shiftKey</span><span style="color: #66cc66;">&#41;</span>
			_zooming = <span style="color: #000000; font-weight: bold;">true</span>;
		<span style="color: #b1b100;">else</span>
			_orbiting = <span style="color: #000000; font-weight: bold;">true</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 *
	 * @param	event
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> mouseMoveHandler<span style="color: #66cc66;">&#40;</span> event : MouseEvent <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> dx:<span style="color: #0066CC;">Number</span> = _lastMouse.<span style="color: #006600;">x</span> - event.<span style="color: #006600;">stageX</span>;
		<span style="color: #000000; font-weight: bold;">var</span> dy:<span style="color: #0066CC;">Number</span> = _lastMouse.<span style="color: #006600;">y</span> - event.<span style="color: #006600;">stageY</span>;
&nbsp;
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>_orbiting<span style="color: #66cc66;">&#41;</span>	<span style="color: #66cc66;">&#123;</span>
			_camYaw += dx <span style="color: #66cc66;">*</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">180</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			_camPitch -= dy <span style="color: #66cc66;">*</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">180</span><span style="color: #66cc66;">&#41;</span>;
			_camPitch = _camPitch <span style="color: #66cc66;">&lt;</span> <span style="color: #cc66cc;">0.001</span> ? <span style="color: #cc66cc;">0.001</span> : _camPitch;
			_camPitch = _camPitch <span style="color: #66cc66;">&gt;</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span> ? <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span> : _camPitch;
&nbsp;
			_lastMouse.<span style="color: #006600;">x</span> = event.<span style="color: #006600;">stageX</span>;
			_lastMouse.<span style="color: #006600;">y</span> = event.<span style="color: #006600;">stageY</span>;
		<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #0066CC;">camera</span>.<span style="color: #006600;">ortho</span> <span style="color: #66cc66;">&amp;&amp;</span> _zooming<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>_camDist - dy <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>
				_camDist -= dy;
		<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">camera</span>.<span style="color: #006600;">ortho</span> <span style="color: #66cc66;">&amp;&amp;</span> _zooming<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// this is the essential bit to zoom the camera in ortho-mode!</span>
			<span style="color: #0066CC;">camera</span>.<span style="color: #006600;">orthoScale</span> += <span style="color: #66cc66;">&#40;</span>dy <span style="color: #66cc66;">*</span> <span style="color: #cc66cc;">0.0005</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		render<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		event.<span style="color: #0066CC;">updateAfterEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 *
	 * @param	event
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> mouseUpHandler<span style="color: #66cc66;">&#40;</span> event : MouseEvent <span style="color: #66cc66;">&#41;</span> : <span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
		_orbiting = _zooming = <span style="color: #000000; font-weight: bold;">false</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/** Are we orbiting the camera? */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _orbiting			: <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** Are we zooming the camera? */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _zooming			: <span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** A Point to keep track of mouse coords */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _lastMouse			: Point;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** Camera Yaw */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _camYaw				: <span style="color: #0066CC;">Number</span> = -<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** Camera Pitch */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _camPitch			: <span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">PI</span><span style="color: #66cc66;">/</span><span style="color: #cc66cc;">2</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** Camera distance */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _camDist			: <span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">2000</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** Camera target */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _camTarget			: DisplayObject3D = DisplayObject3D.<span style="color: #006600;">ZERO</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2008/02/10/papervision3d-frustumcamera3d/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Papervision3D 2.0 : Public Alpha Release</title>
		<link>http://techblog.floorplanner.com/2007/12/05/papervision3d-20-public-alpha-release/</link>
		<comments>http://techblog.floorplanner.com/2007/12/05/papervision3d-20-public-alpha-release/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 02:31:28 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/papervision3d-20-public-alpha-release.html</guid>
		<description><![CDATA[Drumroll!
Papervision3D 2.0 (alpha) was just released! Ralph Hauwert did the bulk of the work, with me standing by as a second brain trying to solve the issues we struggled with last few days. There&#8217;s lots of bugs to be fixed of course, but check out the new stuff:
- viewports
- shaded materials (flat, gouraud, phong, bump [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F12%2F05%2Fpapervision3d-20-public-alpha-release%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F12%2F05%2Fpapervision3d-20-public-alpha-release%2F" height="61" width="51" /></a></div><p>Drumroll!<br />
Papervision3D 2.0 (alpha) was just released! <a href="http://www.unitzeroone.com/blog/">Ralph Hauwert</a> did the bulk of the work, with me standing by as a second brain trying to solve the issues we struggled with last few days. There&#8217;s lots of bugs to be fixed of course, but check out the new stuff:</p>
<p>- viewports<br />
- shaded materials (flat, gouraud, phong, bump etc.)<br />
- frustum culling<br />
- <a href="http://ascollada.org/">ascollada</a> : import Collada files using the <a href="http://ascollada.org/">ASCollada</a> library.<br />
- animation<br />
- more!</p>
<p><a href="http://papervision3d.googlecode.com/svn/trunk/branches/GreatWhite/"><br />
Get the code using SVN.</a></p>
<p>Okay, now i&#8217;ll get some sleep!</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2007/12/05/papervision3d-20-public-alpha-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papervision3D training in Amsterdam, Europe</title>
		<link>http://techblog.floorplanner.com/2007/09/04/papervision3d-training-in-amsterdam-europe/</link>
		<comments>http://techblog.floorplanner.com/2007/09/04/papervision3d-training-in-amsterdam-europe/#comments</comments>
		<pubDate>Tue, 04 Sep 2007 22:37:15 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/papervision3d-training-in-amsterdam-europe.html</guid>
		<description><![CDATA[Papervision3D training is coming to Europe!
The 2 day workshop will be in Amsterdam, The Netherlands on October 8th and 9th, and will be hosted by Ralph Hauwert.
Read more here.
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F09%2F04%2Fpapervision3d-training-in-amsterdam-europe%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F09%2F04%2Fpapervision3d-training-in-amsterdam-europe%2F" height="61" width="51" /></a></div><p><a href="http://blog.papervision3d.org/">Papervision3D</a> training is coming to Europe!<br />
The 2 day workshop will be in Amsterdam, The Netherlands on October 8th and 9th, and will be hosted by <a href="http://www.unitzeroone.com/blog">Ralph Hauwert</a>.</p>
<p><a href="http://blog.papervision3d.org/2007/09/04/papervision3d-training-in-europe-amsterdam-october-8-9">Read more here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2007/09/04/papervision3d-training-in-amsterdam-europe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magic Carpet &#8211; APE</title>
		<link>http://techblog.floorplanner.com/2007/08/21/magic-carpet-ape/</link>
		<comments>http://techblog.floorplanner.com/2007/08/21/magic-carpet-ape/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 19:10:54 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/magic-carpet-ape.html</guid>
		<description><![CDATA[APE (Actionscript Physics Engine) is a free AS3 open source 2D physics engine for use in Flash and Flex, released under the MIT License. APE is written and maintained by Alec Cove.
Manuel Bua created a Magic Carpet using Papervison3D and APE. Best of all: source included!
Check the video Manuel made:


var so_1489456580 = new
SWFObject("http://www.youtube.com/v/HUtjKIuauMk","fm_HUtjKIuauMk_1489456580","410","330","6","","","","","");
so_1489456580.addParam("allowFullScreen", "true");
so_1489456580.write("so_targ_HUtjKIuauMk_1489456580");

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F08%2F21%2Fmagic-carpet-ape%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F08%2F21%2Fmagic-carpet-ape%2F" height="61" width="51" /></a></div><p><a href="http://www.cove.org/ape/">APE</a> (Actionscript Physics Engine) is a free AS3 open source 2D physics engine for use in Flash and Flex, released under the MIT License. <a href="http://www.cove.org/ape/">APE</a> is written and maintained by <a href="http://www.cove.org">Alec Cove</a>.</p>
<p><a href="http://manuel.bit-fire.com/">Manuel Bua</a> created a <a href="http://manuel.bit-fire.com/2007/08/11/carpets-sources/">Magic Carpet</a> using <a href="http://blog.papervision3d.org/">Papervison3D</a> and <a href="http://www.cove.org/ape/">APE</a>. Best of all: source included!</p>
<p>Check the video Manuel made:</p>
<p id="so_targ_HUtjKIuauMk_1489456580">
<p><script type="text/javascript">
var so_1489456580 = new
SWFObject("http://www.youtube.com/v/HUtjKIuauMk","fm_HUtjKIuauMk_1489456580","410","330","6","","","","","");
so_1489456580.addParam("allowFullScreen", "true");
so_1489456580.write("so_targ_HUtjKIuauMk_1489456580");
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2007/08/21/magic-carpet-ape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing ASCOLLADA</title>
		<link>http://techblog.floorplanner.com/2007/08/14/introcuding-ascollada/</link>
		<comments>http://techblog.floorplanner.com/2007/08/14/introcuding-ascollada/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 14:04:31 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[CAD]]></category>
		<category><![CDATA[Flash+ActionScript]]></category>
		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.suite75.net/blog/dev/introcuding-ascollada.html</guid>
		<description><![CDATA[I&#8217;m happy to introduce ascollada, a AS3 library for reading Collada files.
The library is geared towards Papervision3D but should work with any 3D-engine like Away3D or Sandy.
The library currently features:

simple models
material loading (watch your paths!)
biped animation

Please note that the library is still in its very early stages and most likely will contain bugs.
So, get the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F08%2F14%2Fintrocuding-ascollada%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Ftechblog.floorplanner.com%2F2007%2F08%2F14%2Fintrocuding-ascollada%2F" height="61" width="51" /></a></div><p>I&#8217;m happy to introduce <a href="http://code.google.com/p/ascollada/">ascollada</a>, a AS3 library for reading <a href="http://www.collada.org/">Collada</a> files.</p>
<p>The library is geared towards <a href="http://blog.papervision3d.org/">Papervision3D</a> but should work with any 3D-engine like <a href="http://www.away3d.com/">Away3D</a> or <a href="http://www.flashsandy.org/blog/">Sandy</a>.</p>
<p>The library currently features:</p>
<ol>
<li>simple models</li>
<li>material loading (watch your paths!)</li>
<li>biped animation</li>
</ol>
<p>Please note that the library is still in its <strong>very</strong> early stages and most likely will contain bugs.</p>
<p>So, get the code and try it out! And&#8230; <a href="http://code.google.com/p/ascollada/issues/list">please report bugs</a>!</p>
<p>You can get the code using SVN:</p>
<blockquote style="color:#0a0a0a"><p>http://ascollada.googlecode.com/svn/trunk/as3/trunk/</p></blockquote>
<p>Papervision3D users can opt to use the ascollada branch of PV3D&#8217;s svn:</p>
<blockquote style="color:#0a0a0a"><p>http://papervision3d.googlecode.com/svn/trunk/branches/ascollada/</p></blockquote>
<p>There are some examples in the examples directory to get you going.</p>
<p><span id="more-56"></span></p>
<p><strong>USAGE:</strong> for Papervision3D</p>
<blockquote style="color:#0a0a0a"><p>
// the DAE object is like papervision3d&#8217;s Collada object&#8230;<br />
import org.papervision3d.objects.DAE;</p>
<p>var dae:DAE = new DAE( &#8220;somedae.dae&#8221; );</p>
<p>dae.addEventListener( Event.COMPLETE, daeCompleteHandler);</p>
<p>scene.addChild( dae );
</p></blockquote>
<p>You can also pass a MaterialsList to the DAE constructor to override materials defined within the file:</p>
<blockquote style="color:#0a0a0a"><p>var materials:MaterialsList = new MaterialsList();</p>
<p>// create a simple wireframe material<br />
var material:MaterialObject3D = new WireFrameMaterial();</p>
<p>// add to the list, use the materialname as specified<br />
// in the Collada file.<br />
materials.addMaterial( material, &#8220;Default&#8221; );</p>
<p>var dae:DAE = new DAE( &#8220;somedae.dae&#8221;, materials );</p>
<p>scene.addChild( dae );</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://techblog.floorplanner.com/2007/08/14/introcuding-ascollada/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
