<?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>Derek J Entringer &#124; Interactive Media, Web Application, and Mobile App Developer &#187; create</title>
	<atom:link href="http://www.derekentringer.com/blog/tag/create/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.derekentringer.com/blog</link>
	<description>Interactive Media Development, Web Application Development, Mobile App Development, Flash, Flash Media Server, Flex, Flash Component Creation, Game Programming &#38; Design, Blog, CMS, eCommerce Setup &#38; Styling, Search Engine Optimization, Social Networking Strategies, Website Interface &#38; Template Creation, Windows Vista Gadget Development, Apple Widget Development, Email Marketing, Code Samples, Tutorials</description>
	<lastBuildDate>Tue, 13 Jul 2010 19:25:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Papervision3d &#8211; Simple Mouse Controlled Interactive Sphere</title>
		<link>http://www.derekentringer.com/blog/papervision3d-simple-mouse-controlled-interactive-sphere/</link>
		<comments>http://www.derekentringer.com/blog/papervision3d-simple-mouse-controlled-interactive-sphere/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 16:39:26 +0000</pubDate>
		<dc:creator>Derek J Entringer</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[papervision]]></category>
		<category><![CDATA[pitch]]></category>
		<category><![CDATA[sphere]]></category>
		<category><![CDATA[yaw]]></category>

		<guid isPermaLink="false">http://derekentringer.com/blog/?p=42</guid>
		<description><![CDATA[
			
				
			
		

Here&#8217;s a class that renders a simple wireframe sphere in Papervision3d, and allows the mouse to control the pitch and yaw. This example can be applied to any simple interactive environment.

package {
	import flash.display.Sprite;
	import flash.events.Event;
	import org.papervision3d.cameras.*;
	import org.papervision3d.objects.*;
	import org.papervision3d.scenes.*;
	import org.papervision3d.materials.*;

	public class PaperVisionTest extends Sprite {
		/** setup the container */
		private var container: Sprite = new Sprite();

		/** setup the scene */
		private var scene: MovieScene3D = new MovieScene3D(container);

		/** setup the camera */
		private var camera: Camera3D = new Camera3D();

		/** setup the material */
		private var material:WireframeMaterial = new WireframeMaterial(0xFF0000);

		/** setup the sphere */
		private var sphere:Sphere = new ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="clear:left; float:left; margin-top:10px; margin-bottom: 10px; margin-right:12px; margin-left:2px;">
			<a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2FwaS50d2VldG1lbWUuY29tL3NoYXJlP3VybD1odHRwJTNBJTJGJTJGd3d3LmRlcmVrZW50cmluZ2VyLmNvbSUyRmJsb2clMkZwYXBlcnZpc2lvbjNkLXNpbXBsZS1tb3VzZS1jb250cm9sbGVkLWludGVyYWN0aXZlLXNwaGVyZSUyRg=="><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.derekentringer.com%2Fblog%2Fpapervision3d-simple-mouse-controlled-interactive-sphere%2F&amp;source=derekentringer&amp;style=normal&amp;service=TinyURL.com" height="61" width="50" /><br />
			</a>
		</div>
<p><!--PLAIN_TEXT--><br />
Here&#8217;s a class that renders a simple wireframe sphere in Papervision3d, and allows the mouse to control the pitch and yaw. This example can be applied to any simple interactive environment.</p>
<pre class="brush: as3;">
package {
	import flash.display.Sprite;
	import flash.events.Event;
	import org.papervision3d.cameras.*;
	import org.papervision3d.objects.*;
	import org.papervision3d.scenes.*;
	import org.papervision3d.materials.*;

	public class PaperVisionTest extends Sprite {
		/** setup the container */
		private var container: Sprite = new Sprite();

		/** setup the scene */
		private var scene: MovieScene3D = new MovieScene3D(container);

		/** setup the camera */
		private var camera: Camera3D = new Camera3D();

		/** setup the material */
		private var material:WireframeMaterial = new WireframeMaterial(0xFF0000);

		/** setup the sphere */
		private var sphere:Sphere = new Sphere(material, 300, 30, 30);

		/**
		* constructor
		*/
		public function PaperVisionTest() {
			//add the container
			container.x = stage.stageWidth/2;
			container.y = stage.stageHeight/2;
			addChild(container);

			//camera parameters
			camera.z = -500;
			camera.zoom = 5;

			//give the sphere to the scene
			scene.addChild(sphere);

			stage.addEventListener(Event.ENTER_FRAME, update);
		}

		/**
		* Triggered by the enter frame event
		* @param pEvent Event object passed by the dispatcher
		*/
		private function update(pEvent:Event):void {

			//initialize the camera
			sphere.lookAt(camera);

			//mouse movement control
			sphere.pitch(this.mouseY);
			sphere.yaw(this.mouseX);

			//render the scene
			scene.renderCamera(camera);
		}
	}
}
</pre>
<p>The final result:</p>
<p><img src="http://www.derekentringer.com/img/sphere.jpg" border="0" /></p>
<p><a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5kZXJla2VudHJpbmdlci5jb20vZG93bmxvYWRzL1BhcGVydmlzaW9uVGVzdC56aXA=">Click here to download the source.</a></p>
 <img src="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=42" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.derekentringer.com/blog/papervision3d-simple-mouse-controlled-interactive-sphere/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Simple Papervision3d Scene</title>
		<link>http://www.derekentringer.com/blog/simple-papervision3d-scene/</link>
		<comments>http://www.derekentringer.com/blog/simple-papervision3d-scene/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 16:38:49 +0000</pubDate>
		<dc:creator>Derek J Entringer</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[papervision]]></category>
		<category><![CDATA[scene]]></category>

		<guid isPermaLink="false">http://derekentringer.com/blog/?p=40</guid>
		<description><![CDATA[
			
				
			
		

Here&#8217;s a simple scene that renders a Papervision3d scene within a container. There are no 3d elements added, but this is as simple as it gets.

import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
import org.papervision3d.scenes.*;

var container:Sprite = new Sprite();
addChild(container);
container.x = stage.stageWidth * 0.5;
container.y = stage.stageHeight * 0.5;

var scene:Scene3D = new Scene3D(container);
var camera:Camera3D = new Camera3D();
camera.zoom = 11;

addEventListener(Event.ENTER_FRAME, loop);

function loop(e:Event):void
{
    scene.renderCamera(camera);
}

If you&#8217;re interested in how this can be improved, check out the next post with a more elaborate Papervision scene.
 ]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="clear:left; float:left; margin-top:10px; margin-bottom: 10px; margin-right:12px; margin-left:2px;">
			<a href="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2FwaS50d2VldG1lbWUuY29tL3NoYXJlP3VybD1odHRwJTNBJTJGJTJGd3d3LmRlcmVrZW50cmluZ2VyLmNvbSUyRmJsb2clMkZzaW1wbGUtcGFwZXJ2aXNpb24zZC1zY2VuZSUyRg=="><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.derekentringer.com%2Fblog%2Fsimple-papervision3d-scene%2F&amp;source=derekentringer&amp;style=normal&amp;service=TinyURL.com" height="61" width="50" /><br />
			</a>
		</div>
<p><!--PLAIN_TEXT--><br />
Here&#8217;s a simple scene that renders a Papervision3d scene within a container. There are no 3d elements added, but this is as simple as it gets.</p>
<pre class="brush: as3;">
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
import org.papervision3d.scenes.*;

var container:Sprite = new Sprite();
addChild(container);
container.x = stage.stageWidth * 0.5;
container.y = stage.stageHeight * 0.5;

var scene:Scene3D = new Scene3D(container);
var camera:Camera3D = new Camera3D();
camera.zoom = 11;

addEventListener(Event.ENTER_FRAME, loop);

function loop(e:Event):void
{
    scene.renderCamera(camera);
}
</pre>
<p>If you&#8217;re interested in how this can be improved, check out the next post with a more elaborate Papervision scene.</p>
 <img src="http://www.derekentringer.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=40" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.derekentringer.com/blog/simple-papervision3d-scene/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
