Papervision 3D Programming Tutorial - BitmapViewport

Posted Feb 09, 2009 by mcasperson / comments 1 comments / Print / Font Size Decrease font size Increase font size

A demo that demonstrates how to use the BitmapViewport in Papervision to archive some interesting effects. Demo and source code included.

VIEW THE DEMO
DOWNLOAD THE CODE

In previous demos I have shown how you can add some of the standard Flash effects to individual Papervision 3D objects, allowing you to blur, modify colors and add a glow to a 3D object. In addition to adding effects to objects, you can also add effects to the entire viewport thanks to the BitmapViewport3D class. The BitmapViewport3D has a bitmapData Property, which you can then apply a filter to with the applyFilter function. You simply supply the same standard Flash effects classes, like Blur, to the applyFilter function after rendering the scene.

You’ll notice in the EngineManager class we set the fillBeforeRender property of the viewport to false by default. This has the effect of stopping Papervision from clearing the screen before rendering the next frame. We also make use of the colorTransform function to slowly fade out the accumulated effects of the previous frames, giving the effect of a “comet trail” behind any moving objects. You can play with these three effects (apply a Blur filter, disabling the fillBeforeRender property and applying the colorTransform) using the three checkboxes on the side of the screen.

The demo code is based on the application structure described here. If you're looking at the source almost all of the classes and functions mentioned here have been implemented in the EngineManager class.

Check out more web development tutorials and articles here.

Rate this Article:

Be the first to rate me.


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

Comments

researchanalyst
researchanalyst said... on February 24th, 2009 at 2:06 AM

this tutorial on papervision 3d programming is helpful with the color transform function when adding standard flash effects, this is useful thanks.



Bookmark and Share
Sign up for our email newsletter
Name:
Email: