<?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"
	>

<channel>
	<title>Rustpunk</title>
	<atom:link href="http://www.rustpunk.co.za/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.rustpunk.co.za/blog</link>
	<description>Flash, Papervision3D, Blender, Cast3D</description>
	<pubDate>Wed, 09 Jun 2010 11:45:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Success! Animated Blender Models in PV3D</title>
		<link>http://www.rustpunk.co.za/blog/?p=10</link>
		<comments>http://www.rustpunk.co.za/blog/?p=10#comments</comments>
		<pubDate>Mon, 08 Sep 2008 12:39:15 +0000</pubDate>
		<dc:creator>brad</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Cast3D]]></category>

		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.rustpunk.co.za/blog/?p=10</guid>
		<description><![CDATA[Blender users finally have a way of bringing animated models into PV3D thanks to the newest revision of Cast3D which now also features a dae2X3c converter (see previous post if you&#8217;re not familiar with cast3d). Dmitri Sviridov has been hard at work on fixing bugs and ironing out the kinks in both the blender collada [...]]]></description>
			<content:encoded><![CDATA[<p>Blender users finally have a way of bringing animated models into PV3D thanks to the newest revision of Cast3D which now also features a dae2X3c converter (see previous post if you&#8217;re not familiar with cast3d). Dmitri Sviridov has been hard at work on fixing bugs and ironing out the kinks in both the blender collada exporter and the cast3d library.</p>
<p>You can see one of my animated models in the cast3d demo section. It&#8217;s not the most fantastic walk cycle ever, but hell it&#8217;s an animated model successfully exported from Blender into PV3D! Sweet! Cast3d features comprehensive timeline controls too.</p>
<p><a href="http://cast3d.org/demos:lwalkfig"><img src="img/walk.jpg" alt="Animated Blender Model In PV3D"></a></p>
<p>(PS. Ignore the casino link on the top left corner - my blog has been hacked. I&#8217;ll sort it soon.).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustpunk.co.za/blog/?feed=rss2&amp;p=10</wfw:commentRss>
		</item>
		<item>
		<title>Animated Models: Blender to PV3D</title>
		<link>http://www.rustpunk.co.za/blog/?p=9</link>
		<comments>http://www.rustpunk.co.za/blog/?p=9#comments</comments>
		<pubDate>Mon, 30 Jun 2008 20:19:49 +0000</pubDate>
		<dc:creator>brad</dc:creator>
		
		<category><![CDATA[Blender]]></category>

		<category><![CDATA[Cast3D]]></category>

		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.rustpunk.co.za/blog/?p=9</guid>
		<description><![CDATA[Some thoughts on the Blender/Papervision3d workflow,  collada and Cast3d.
Blenderâ€™s collada (.dae) exporter does a great job of exporting mesh data for static models, but it stops playing nicely with PV3D as soon as you export keyframed animation or bone data. The great news is that Tim Knip, the man behind PV3Dâ€™s dae parser, is [...]]]></description>
			<content:encoded><![CDATA[<p>Some thoughts on the Blender/Papervision3d workflow,  collada and Cast3d.<span id="more-9"></span></p>
<p>Blenderâ€™s collada (.dae) exporter does a great job of exporting mesh data for static models, but it stops playing nicely with PV3D as soon as you export keyframed animation or bone data. The great news is that Tim Knip, the man behind PV3Dâ€™s dae parser, is planning to add a blender flag to the parser, to remedy this.</p>
<p>Another great open-source 3d library for bringing animated models into PV3D,  is Cast3D which has features like support for sound, animation controls &amp; more. Brilliant!</p>
<p>Cast3d has itâ€™s own lightweight xml format (.x3c) with a command line converter which builds .x3c files from studio max files (.3ds) . Again, blenders exporters prove a little buggy as the blender script exports 3ds files without the node info required by the cast3d converter.</p>
<p>Fortunately, Cast3D&#8217;s creator, Dmitri Sviridov, is working on a .dae to .x3c converter which he tells me will also work with blender .dae files! It&#8217;s well worth checking the cast3d site to check out it&#8217;s great animation support, but hereâ€™s a simple unanimated example for cast3d/pv3d 2.0.</p>
<p>(Since I canâ€™t export models from blender to a usable .3ds, I downloaded a cool little model from Turbosquid for this post.)</p>
<p><strong>Setting up Cast3D for Papervision 3d 2.0:</strong></p>
<p>Cast3d is designed for use with a number of 3d engines so you may need to make some very minor tweaks to get it working with PV3D v2.0.</p>
<p>1) Open cast3d/core/Source3d.as</p>
<ul>
<li>a) Uncomment import cast3d.geom.ppv2.*;</li>
<li>b) Make sure import statements for other 3d engines are commented out</li>
</ul>
<p>2) Open cast3d/loader/Xc3loader.as:</p>
<ul>
<li>a) Uncomment import cast3d.loader.ppv2.Xc3PortLoader;</li>
<li>b) Make sure import statements for other 3d engines are commented out</li>
</ul>
<p>3) It should be working fine after the previous changes, but if not, try removing the Sandy3d, Away3d and older papervision folders:</p>
<ul>
<li>a) In the cast3d/geom folder, removed away3d, ppv3d and sandy3d folders</li>
<li>b) In cast3d/loader folder, remove ppv3d and sandy3d folders.</li>
</ul>
<p><strong>Preparing Your Model:</strong><br />
Youâ€™ll need to use the command line converter to create .x3c file from the .3ds file. Launch command line prompt, navigate to the directory with the .3ds file and use the converter as follows.</p>
<pre>C:\Buggy\3ds2XML buggy.3ds buggy.x3c</pre>
<p>Now youâ€™re ready to write some code.</p>
<p>Create a cast3d object:</p>
<pre>
var animator:Cast3d = new Cast3d(scene, camera);</pre>
<p>Create an X3CLoader to load model:</p>
<pre>
var loader:X3CLoader = new Xc3Loader("models/buggy/buggy.x3c");

loader.resourcePath = "models/buggy/data";

loader.addEventListener(LoadEvent.LOAD_COMPLETE, cast3dLoadComplete);

loader.addEventListener(LoadEvent.LOAD_ERROR, cast3dLoadError);

loader.load(animator.source);</pre>
<p>Create a Trackball Object to allow rotation of the model. (This class also ensures the camera always points at your model)</p>
<pre>
var manipulator:Trackball = new TrackBall(animator, stage,

view.viewportWidth, view.viewportHeight,

Manipulator.Z_UP,

Manipulator.X_S,Manipulator.Z_S,Manipulator.Y_S

);</pre>
<p>Last you need to perform a cast3d render before rendering your PV3D scene.</p>
<pre>
animator.render();

render.renderScene(scene, camera, view);</pre>
<p>And the result.</p>
<p><img src="img/buggy.jpg" alt="Buggy Render" /></p>
<p>Nice!</p>
<p><a href="src/SimpleCast.as">Source</a><br />
<a href="compressed/buggy_Cast3d.zip">Complete project</a> (fla, swf, source and model).</p>
<p>Links:<br />
<a href="http://cast3d.org" title="Cast3D" target="_blank">http://cast3d.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustpunk.co.za/blog/?feed=rss2&amp;p=9</wfw:commentRss>
		</item>
		<item>
		<title>Papervision3D- Materials Demo</title>
		<link>http://www.rustpunk.co.za/blog/?p=7</link>
		<comments>http://www.rustpunk.co.za/blog/?p=7#comments</comments>
		<pubDate>Fri, 21 Mar 2008 16:57:07 +0000</pubDate>
		<dc:creator>brad</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.rustpunk.co.za/blog/?p=7</guid>
		<description><![CDATA[I put together a small material demo file to familiarize myself with some of the shade materials in pv3d v2. It&#8217;s not exhaustive, only featuring the shadeMaterials (not shaders/shadedmaterials) but I found it useful in getting to grips with the various shading options in pv3d. It also includes some of the simple materials like bitmap [...]]]></description>
			<content:encoded><![CDATA[<p>I put together a small material demo file to familiarize myself with some of the shade materials in pv3d v2. It&#8217;s not exhaustive, only featuring the shadeMaterials (not shaders/shadedmaterials) but I found it useful in getting to grips with the various shading options in pv3d. It also includes some of the simple materials like bitmap Asset, movie Asset, and wireframe for reference.</p>
<p><a href="swf/materialDemo.swf"><img src="img/materialDemo.jpg" alt="materials demo" /></a></p>
<p><a href="swf/materialDemo.swf">Example</a><br />
<a href="src/DaeShadeMaterial.as">Source</a></p>
<p>(To rotate model, click + drag left/right)</p>
<p>For users of the SVN repository: This file uses an older revision (442) of the effects branch as there seems to be a bug with replaceMaterialByName and shadeMaterials in the more recent revision (444) at the time of writing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustpunk.co.za/blog/?feed=rss2&amp;p=7</wfw:commentRss>
		</item>
		<item>
		<title>Papervision3D - Animated Movie Asset Material</title>
		<link>http://www.rustpunk.co.za/blog/?p=6</link>
		<comments>http://www.rustpunk.co.za/blog/?p=6#comments</comments>
		<pubDate>Thu, 20 Mar 2008 13:47:37 +0000</pubDate>
		<dc:creator>brad</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.rustpunk.co.za/blog/?p=6</guid>
		<description><![CDATA[I&#8217;ve been playing around with the animated property of the movie materials the last couple of days, because let&#8217;s face it, animated textures are pretty damn cool. The only things you need to do to set this up is to set the animated property of your material to true, and then to set up an [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with the animated property of the movie materials the last couple of days, because let&#8217;s face it, animated textures are pretty damn cool. The only things you need to do to set this up is to set the animated property of your material to true, and then to set up an enterFrame listener to render the scene.</p>
<p>If you set the smooth  property of your material to true,  then be sure to also set tiled to true or your movie may lock up at at certain angles.</p>
<p><a href="swf/AnimateMovieAssetMaterial.swf"><img src="img/animateMovieAssetMaterial.jpg" alt="animated movie asset material" /></a></p>
<p><a href="swf/AnimateMovieAssetMaterial.swf">Example</a><br />
<a href="src/AnimateMovieAssetMaterial.as">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustpunk.co.za/blog/?feed=rss2&amp;p=6</wfw:commentRss>
		</item>
		<item>
		<title>Papervision3D- Bump Mapped Material</title>
		<link>http://www.rustpunk.co.za/blog/?p=5</link>
		<comments>http://www.rustpunk.co.za/blog/?p=5#comments</comments>
		<pubDate>Mon, 11 Feb 2008 11:16:24 +0000</pubDate>
		<dc:creator>brad</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.rustpunk.co.za/blog/?p=5</guid>
		<description><![CDATA[Some of the coolest features added to papervision 2 (great white)  are those relating to lights and shading. The phongShader also allows you to apply bump maps to your models:
//create simple material
var ballMat:MovieAssetMaterial = new MovieAssetMaterial("tennisMat");
//create bump map material
var ballBumpMat:MovieAssetMaterial = new MovieAssetMaterial("tennisBump");
//create phong shader
var ballShader:PhongShader = new PhongShader(pointLight, 0x145A22, 0x4AD766, 20, ballBumpMat.bitmap,
ballMat.bitmap);
//combine the [...]]]></description>
			<content:encoded><![CDATA[<p>Some of the coolest features added to papervision 2 (great white)  are those relating to lights and shading. The phongShader also allows you to apply bump maps to your models:</p>
<pre>//create simple material
var ballMat:MovieAssetMaterial = new MovieAssetMaterial("tennisMat");
//create bump map material
var ballBumpMat:MovieAssetMaterial = new MovieAssetMaterial("tennisBump");
//create phong shader
var ballShader:PhongShader = new PhongShader(pointLight, 0x145A22, 0x4AD766, 20, ballBumpMat.bitmap,
ballMat.bitmap);
//combine the shader with the original material
var ballShadedMat:ShadedMaterial = new ShadedMaterial(ballMat, ballShader);</pre>
<p><a href="swf/environmentalShader.swf"><img src="img/bumpMapTennisBall.gif" alt="bump map material" /></a></p>
<p><a href="swf/environmentalShader.swf">Example</a><br />
<a href="src/myEnvironmentalShader.as">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustpunk.co.za/blog/?feed=rss2&amp;p=5</wfw:commentRss>
		</item>
		<item>
		<title>Papervision3D- Tiling Materials</title>
		<link>http://www.rustpunk.co.za/blog/?p=4</link>
		<comments>http://www.rustpunk.co.za/blog/?p=4#comments</comments>
		<pubDate>Mon, 11 Feb 2008 11:13:10 +0000</pubDate>
		<dc:creator>brad</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.rustpunk.co.za/blog/?p=4</guid>
		<description><![CDATA[To create a tile material, you simply need to set the tiled property to true, and then set maxU and maxV properties to the number of tiles.eg.

var tiledMat:BitmapAssetMaterial = new BitmapAssetMaterial("AlgaeMetalPlate");
tiledMat.tiled = true;
tiledMat.maxU = 2;
tiledMat.maxV = 2;

Example
Source
]]></description>
			<content:encoded><![CDATA[<p>To create a tile material, you simply need to set the tiled property to true, and then set maxU and maxV properties to the number of tiles.eg.</p>
<pre>
var tiledMat:BitmapAssetMaterial = new BitmapAssetMaterial("AlgaeMetalPlate");
tiledMat.tiled = true;
tiledMat.maxU = 2;
tiledMat.maxV = 2;</pre>
<p><a href="swf/myTiledTexture.swf"><img src="img/tiledMat.jpg" alt="tiled material" /></a></p>
<p><a href="swf/myTiledTexture.swf">Example</a><br />
<a href="src/myTiledTexture.as">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustpunk.co.za/blog/?feed=rss2&amp;p=4</wfw:commentRss>
		</item>
		<item>
		<title>Papervision3D- Creating a Composite Material</title>
		<link>http://www.rustpunk.co.za/blog/?p=3</link>
		<comments>http://www.rustpunk.co.za/blog/?p=3#comments</comments>
		<pubDate>Mon, 11 Feb 2008 11:09:08 +0000</pubDate>
		<dc:creator>brad</dc:creator>
		
		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Papervision3D]]></category>

		<guid isPermaLink="false">http://www.rustpunk.co.za/blog/?p=3</guid>
		<description><![CDATA[A composite material allows you to layer multiple simple materials in a new &#8220;combined&#8221; material:
var wireMat:WireframeMaterial = new WireframeMaterial(0xCCCCFF);
var colorMat:ColorMaterial = new ColorMaterial(0x00FFCC);
var compMat:CompositeMaterial = new CompositeMaterial();
compMat.addMaterial(wireMat);
compMat.addMaterial(colorMat);

Example
Source
]]></description>
			<content:encoded><![CDATA[<p>A composite material allows you to layer multiple simple materials in a new &#8220;combined&#8221; material:</p>
<pre>var wireMat:WireframeMaterial = new WireframeMaterial(0xCCCCFF);
var colorMat:ColorMaterial = new ColorMaterial(0x00FFCC);
var compMat:CompositeMaterial = new CompositeMaterial();
compMat.addMaterial(wireMat);
compMat.addMaterial(colorMat);</pre>
<p><a href="swf/compositeMaterial2.swf"><img src="img/compMat.jpg" alt="composite material" /></a></p>
<p><a href="swf/compositeMaterial2.swf">Example</a><br />
<a href="src/myCompositeMaterial2.as">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustpunk.co.za/blog/?feed=rss2&amp;p=3</wfw:commentRss>
		</item>
	</channel>
</rss>
