<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: TriangleMesh3D &#8211; Create your own mesh</title>
	<atom:link href="http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/feed/" rel="self" type="application/rss+xml" />
	<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/</link>
	<description>Papervision3D, ActionScript, and Flex examples and tutorials by John Lindquist</description>
	<lastBuildDate>Wed, 08 Feb 2012 17:26:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: 1010013548</title>
		<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/comment-page-1/#comment-32667</link>
		<dc:creator>1010013548</dc:creator>
		<pubDate>Sat, 18 Sep 2010 18:37:36 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=229#comment-32667</guid>
		<description>you can use getMaterialByName  method and getChildByName    to control it  
&lt;br&gt;
&lt;br&gt;你可以给那个面的材质命名！然后getMaterialByName 得到材质使其具有交互性  用getChildByName得到该面对象</description>
		<content:encoded><![CDATA[<p>you can use getMaterialByName  method and getChildByName    to control it  </p>
<p>你可以给那个面的材质命名！然后getMaterialByName 得到材质使其具有交互性  用getChildByName得到该面对象</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 1010013548</title>
		<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/comment-page-1/#comment-29369</link>
		<dc:creator>1010013548</dc:creator>
		<pubDate>Sat, 18 Sep 2010 11:37:36 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=229#comment-29369</guid>
		<description>you can use getMaterialByName  method and getChildByName    to control it  
&lt;br&gt;
&lt;br&gt;你可以给那个面的材质命名！然后getMaterialByName 得到材质使其具有交互性  用getChildByName得到该面对象</description>
		<content:encoded><![CDATA[<p>you can use getMaterialByName  method and getChildByName    to control it  </p>
<p>你可以给那个面的材质命名！然后getMaterialByName 得到材质使其具有交互性  用getChildByName得到该面对象</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 周杰</title>
		<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/comment-page-1/#comment-28661</link>
		<dc:creator>周杰</dc:creator>
		<pubDate>Tue, 07 Sep 2010 22:04:09 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=229#comment-28661</guid>
		<description>Now. There is a *. dae file, which has a model of how to get the model of a face. Or which part. And then interact with the surface and the mouse?
&lt;br&gt;现在.有一个*.dae文件，里面有一个模型，该如何获得这个模型的一个面.或者其中的一部份.然后用这个面与鼠标交互？</description>
		<content:encoded><![CDATA[<p>Now. There is a *. dae file, which has a model of how to get the model of a face. Or which part. And then interact with the surface and the mouse?<br />
<br />现在.有一个*.dae文件，里面有一个模型，该如何获得这个模型的一个面.或者其中的一部份.然后用这个面与鼠标交互？</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: king</title>
		<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/comment-page-1/#comment-20261</link>
		<dc:creator>king</dc:creator>
		<pubDate>Sun, 21 Mar 2010 07:47:46 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=229#comment-20261</guid>
		<description>can  you teach me how can I add a BitmapMaterial on the mesh?&lt;br&gt;&lt;br&gt;&lt;a href=&quot;mailto:kingg64@hotmail.com&quot; rel=&quot;nofollow&quot;&gt;kingg64@hotmail.com&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>can  you teach me how can I add a BitmapMaterial on the mesh?</p>
<p><a href="mailto:kingg64@hotmail.com" rel="nofollow">kingg64@hotmail.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/comment-page-1/#comment-15979</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 04 Jan 2010 15:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=229#comment-15979</guid>
		<description>When creating a plane or another primitive, papervision creates the UV for each triangle in the primitive. For this example however, one has to manually compute the UV array. Being new to this kind of stuff i can&#039;t seem to understand how this is done so i kind of need some help on this one.

Regards,
Alex.</description>
		<content:encoded><![CDATA[<p>When creating a plane or another primitive, papervision creates the UV for each triangle in the primitive. For this example however, one has to manually compute the UV array. Being new to this kind of stuff i can&#8217;t seem to understand how this is done so i kind of need some help on this one.</p>
<p>Regards,<br />
Alex.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas</title>
		<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/comment-page-1/#comment-782</link>
		<dc:creator>Tomas</dc:creator>
		<pubDate>Thu, 26 Feb 2009 23:37:19 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=229#comment-782</guid>
		<description>I don&#039;t know why I read Trianglesaurus Rex...</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know why I read Trianglesaurus Rex&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/comment-page-1/#comment-779</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Thu, 26 Feb 2009 17:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=229#comment-779</guid>
		<description>Hi John,

I&#039;ve taken this tutorial further and created a bunch of faces that will tween to become a sphere.

Earlier on this site, I requested a way to explode faces and I think I found a way to do a reverse explosion. I don&#039;t think it&#039;s the most efficient way but I&#039;d like to know your thoughts. 

Here is the code that I&#039;m using. It might not work if you just copy and paste. I&#039;m using FlashDevelop with a preloader. This is the code from Main.as.

package 
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	// import papervision
	import org.papervision3d.view.BasicView;
	import org.papervision3d.core.geom.TriangleMesh3D;
	import org.papervision3d.core.geom.renderables.Triangle3D;
	import org.papervision3d.core.geom.renderables.Vertex3D;
	import org.papervision3d.core.math.NumberUV;
	import org.papervision3d.materials.ColorMaterial;
	import org.papervision3d.objects.primitives.Sphere;
	
	// import tweener
	import caurina.transitions.Tweener;
	
	/**
	 * ...
	 * @author DefaultUser (Tools -&gt; Custom Arguments...)
	 */
	public class Main extends BasicView
	{	
		private var allTriangles:Array = new Array();
		
		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			
			// create a sphere so we can grab all of its faces
			var sphere:Sphere = new Sphere(null, 100, 15, 15);
			var sphereFaces:Array = sphere.geometry.faces;
			
			// create a ColorMaterial that we&#039;ll add to each triangle we create
			var material:ColorMaterial = new ColorMaterial(0xCC0000);
			material.doubleSided = true;
			
			// loop through each of the faces in the sphere
			for each (var sphereTriangle:Triangle3D in sphereFaces)
			{
				// add all of vertices for the triangle in the an array
				var sphereTriangleVertices:Array = sphereTriangle.vertices;
				
				// create an array that will later contain the vertices for the triangle we&#039;ll create
				var triangleVertices:Array = new Array();
				
				// loop through all of the vertices
				for each (var sphereTriangleVertex3D:Vertex3D in sphereTriangleVertices)
				{
					// create a new Vertex3D and set its vertices
					var vertex3D:Vertex3D = new Vertex3D(sphereTriangleVertex3D.x, sphereTriangleVertex3D.y, sphereTriangleVertex3D.z);
					
					// push the newly created Vertex3D to the triangleVertices array
					triangleVertices.push(vertex3D);
				}			
				
				// create a new Triangle3D
				// we set the uv from the triangle in the sphere so we can add listeners later if we want
				var triangle3D:Triangle3D = new Triangle3D(null, triangleVertices, material, sphereTriangle.uv);
				
				// create an array that will contain the triangle faces
				var triangleFaces:Array = [triangle3D];
				
				// create a new TriangleMesh3D
				var triangleMesh3D:TriangleMesh3D = new TriangleMesh3D(material, triangleVertices, triangleFaces, null);
				
				// create the triangle3D&#039;s dad
				triangle3D.instance = triangleMesh3D;
				
				// position the triangleMesh3D randomly
				triangleMesh3D.x = Math.random() * 1500 - 750;
				triangleMesh3D.y = Math.random() * 1500 - 750;
				triangleMesh3D.z = Math.random() * 1000 - 500;
				triangleMesh3D.rotationY = Math.random() * 360 - (360 / 2);
				
				// add the triangleMesh3D to the allTriangles array
				allTriangles.push(triangleMesh3D);
				
				// add the triangleMesh3D to the stage
				scene.addChild(triangleMesh3D);
			}
			
			// render the scene
			startRendering();
			
			// tween each triangle to it&#039;s original position
			for each (var triangle:TriangleMesh3D in allTriangles)
			{
				Tweener.addTween(triangle, { x:0, y:0, z:0, rotationY:0, time:2, delay:2 } );
			}
		}
		
	}
	
}</description>
		<content:encoded><![CDATA[<p>Hi John,</p>
<p>I&#8217;ve taken this tutorial further and created a bunch of faces that will tween to become a sphere.</p>
<p>Earlier on this site, I requested a way to explode faces and I think I found a way to do a reverse explosion. I don&#8217;t think it&#8217;s the most efficient way but I&#8217;d like to know your thoughts. </p>
<p>Here is the code that I&#8217;m using. It might not work if you just copy and paste. I&#8217;m using FlashDevelop with a preloader. This is the code from Main.as.</p>
<p>package<br />
{<br />
	import flash.display.Sprite;<br />
	import flash.events.Event;</p>
<p>	// import papervision<br />
	import org.papervision3d.view.BasicView;<br />
	import org.papervision3d.core.geom.TriangleMesh3D;<br />
	import org.papervision3d.core.geom.renderables.Triangle3D;<br />
	import org.papervision3d.core.geom.renderables.Vertex3D;<br />
	import org.papervision3d.core.math.NumberUV;<br />
	import org.papervision3d.materials.ColorMaterial;<br />
	import org.papervision3d.objects.primitives.Sphere;</p>
<p>	// import tweener<br />
	import caurina.transitions.Tweener;</p>
<p>	/**<br />
	 * &#8230;<br />
	 * @author DefaultUser (Tools -&gt; Custom Arguments&#8230;)<br />
	 */<br />
	public class Main extends BasicView<br />
	{<br />
		private var allTriangles:Array = new Array();</p>
<p>		public function Main():void<br />
		{<br />
			if (stage) init();<br />
			else addEventListener(Event.ADDED_TO_STAGE, init);<br />
		}</p>
<p>		private function init(e:Event = null):void<br />
		{<br />
			removeEventListener(Event.ADDED_TO_STAGE, init);<br />
			// entry point</p>
<p>			// create a sphere so we can grab all of its faces<br />
			var sphere:Sphere = new Sphere(null, 100, 15, 15);<br />
			var sphereFaces:Array = sphere.geometry.faces;</p>
<p>			// create a ColorMaterial that we&#8217;ll add to each triangle we create<br />
			var material:ColorMaterial = new ColorMaterial(0xCC0000);<br />
			material.doubleSided = true;</p>
<p>			// loop through each of the faces in the sphere<br />
			for each (var sphereTriangle:Triangle3D in sphereFaces)<br />
			{<br />
				// add all of vertices for the triangle in the an array<br />
				var sphereTriangleVertices:Array = sphereTriangle.vertices;</p>
<p>				// create an array that will later contain the vertices for the triangle we&#8217;ll create<br />
				var triangleVertices:Array = new Array();</p>
<p>				// loop through all of the vertices<br />
				for each (var sphereTriangleVertex3D:Vertex3D in sphereTriangleVertices)<br />
				{<br />
					// create a new Vertex3D and set its vertices<br />
					var vertex3D:Vertex3D = new Vertex3D(sphereTriangleVertex3D.x, sphereTriangleVertex3D.y, sphereTriangleVertex3D.z);</p>
<p>					// push the newly created Vertex3D to the triangleVertices array<br />
					triangleVertices.push(vertex3D);<br />
				}			</p>
<p>				// create a new Triangle3D<br />
				// we set the uv from the triangle in the sphere so we can add listeners later if we want<br />
				var triangle3D:Triangle3D = new Triangle3D(null, triangleVertices, material, sphereTriangle.uv);</p>
<p>				// create an array that will contain the triangle faces<br />
				var triangleFaces:Array = [triangle3D];</p>
<p>				// create a new TriangleMesh3D<br />
				var triangleMesh3D:TriangleMesh3D = new TriangleMesh3D(material, triangleVertices, triangleFaces, null);</p>
<p>				// create the triangle3D&#8217;s dad<br />
				triangle3D.instance = triangleMesh3D;</p>
<p>				// position the triangleMesh3D randomly<br />
				triangleMesh3D.x = Math.random() * 1500 &#8211; 750;<br />
				triangleMesh3D.y = Math.random() * 1500 &#8211; 750;<br />
				triangleMesh3D.z = Math.random() * 1000 &#8211; 500;<br />
				triangleMesh3D.rotationY = Math.random() * 360 &#8211; (360 / 2);</p>
<p>				// add the triangleMesh3D to the allTriangles array<br />
				allTriangles.push(triangleMesh3D);</p>
<p>				// add the triangleMesh3D to the stage<br />
				scene.addChild(triangleMesh3D);<br />
			}</p>
<p>			// render the scene<br />
			startRendering();</p>
<p>			// tween each triangle to it&#8217;s original position<br />
			for each (var triangle:TriangleMesh3D in allTriangles)<br />
			{<br />
				Tweener.addTween(triangle, { x:0, y:0, z:0, rotationY:0, time:2, delay:2 } );<br />
			}<br />
		}</p>
<p>	}</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Lindquist</title>
		<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/comment-page-1/#comment-354</link>
		<dc:creator>John Lindquist</dc:creator>
		<pubDate>Tue, 06 Jan 2009 15:19:55 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=229#comment-354</guid>
		<description>@trix - I didn&#039;t create the UV in this example (to keep it simple), so it won&#039;t know how to map the bitmap on the object. I&#039;ll put it on my list to posts to make.</description>
		<content:encoded><![CDATA[<p>@trix &#8211; I didn&#8217;t create the UV in this example (to keep it simple), so it won&#8217;t know how to map the bitmap on the object. I&#8217;ll put it on my list to posts to make.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: trix</title>
		<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/comment-page-1/#comment-353</link>
		<dc:creator>trix</dc:creator>
		<pubDate>Tue, 06 Jan 2009 13:55:39 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=229#comment-353</guid>
		<description>Is it possible to apply a BitmapAssetMaterial on the TriangleMesh3D? I tried but I get an error #1009
BitmapColorMaterial works fine as well as the ColorMaterial in your example.
--
ERROR: MaterialObject3D: transformUV() uv not found! 
TypeError: Error #1009: Cannot access a property or method of a null object reference.</description>
		<content:encoded><![CDATA[<p>Is it possible to apply a BitmapAssetMaterial on the TriangleMesh3D? I tried but I get an error #1009<br />
BitmapColorMaterial works fine as well as the ColorMaterial in your example.<br />
&#8211;<br />
ERROR: MaterialObject3D: transformUV() uv not found!<br />
TypeError: Error #1009: Cannot access a property or method of a null object reference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JB</title>
		<link>http://pv3d.org/2008/12/13/trianglemesh3d-create-your-own-mesh/comment-page-1/#comment-336</link>
		<dc:creator>JB</dc:creator>
		<pubDate>Sun, 04 Jan 2009 11:23:31 +0000</pubDate>
		<guid isPermaLink="false">http://pv3d.org/?p=229#comment-336</guid>
		<description>Is it possible to use quaterFaces?

Tried
triangleMesh3d.quarterFaces();

but that throws an error
papervision3d\core\geom\TriangleMesh3D.as:285]</description>
		<content:encoded><![CDATA[<p>Is it possible to use quaterFaces?</p>
<p>Tried<br />
triangleMesh3d.quarterFaces();</p>
<p>but that throws an error<br />
papervision3d\core\geom\TriangleMesh3D.as:285]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
