Papervision 3D Programming Tutorial - Creating a Papervision Component

Mar 10th, 2009 by mcasperson

See how Papervision can be packaged into a SWC Flash component, which allows you to drag and drop Papervision into any Flex or Flash application. Demo and source code included.

For all of Papervision's technical brilliance, there is one major factor that prevents it being used in more Flash applications: it's complicated. You need a good understanding of ActionScript, 3D concepts and some fairly low level resource loading and handling techniques in order to use Papervision, which are skills that very few artists have. For those used to drawing and animating an image, and maybe dropping a button or two onto a canvas, Papervision is just something that is too complicated to use.

Fortunately Flash has introduced the concept of components, which allows you to create a UI element that can be dropped onto a Flash application and edited just like you would a button or a combo box. It removed the need to know anything about ActionScript because all the properties can be accessed and modified by the graphical editor.

Technically speaking these components are just subclasses of the UIComponent class. Those who have been following my posts will realised that I have already extended the UIComponent class for the EngineManager. However there are a few more functions that need to be overridden before you can use Papervision as a drag and drop component. I won't go into the details of how to create a Flash component, but you can find the details at http://s.scribd.com/doc/136930/Creating-and-Extending-Flex-Components.

As you can see (if you look at the source code) once Papervision has been packed into a SWC component it is simply a matter of dropping it onto you application and modifying a few parameters. The actual code from the end users point of view is next to nothing (see the ModelViewerTestApp.mxml file for an example).

Check out the demo here, and download the source code here.

Back to Papervision Tutorials

mcasperson

Written by mcasperson

Rate this Article:

Rating: 5.0/5 (1 votes cast)

Add new comment

* You must be logged in order to leave comments, please Sign in or join us.

Comments

No comments yet, be the first to comment on this article.

Related Content