Alternativa Platform – Beauty in 3D

Alternative PlatformI just came across the latest build (v5) of the Alternativa Platform on their blog. The latest demos are a thing of beauty! They have clearly put a lot of hard work into this engine and it is definitely worth while to take note of its power. It has some of the smoothest motion that I have come across in a 3D engine for Flash and looks to have a very promising future.

Here are their latest demos:

Papervision Actionscript 2 BitmapFileMaterial

I have kept it no secret that I would really like to become much more familiar with Papervision. This means playing around with it. While I would ultimately like to be able to use AS3, I decided that I would like to learn a little bit about PV3d in a more familiar language.

Upon decided to try a project in AS2, I instantly discovered that there are many short-comings when comparing the capabilities the AS2 version to the AS3 version. One thing that I felt I needed to do was load external images as materials for objects. I searched and I searched and didn’t really find much to support my need. I did manage to find a class called LoadArrayMaterials written by JLM at Justinfront DOT net. This was very helpful, but I thought that I might like to load one image at a time.

I decided to write the class myself using the guidance of JLM’s classfile. The result, a quick class that does just what I want !

* BitmapFileMaterial
* uses the functionality from the built in BitmapMaterial
* in PV3D to allow the user to assign an external image
* to a material in as2
* @author: Marc Pelland
* @date: April 13, 2008
* ***************************************************************************
* Example:
*     var myMaterial:BitmapFileMaterial = new BitmapFileMaterial();
*     myMaterial.loadImage([i].image.text);
*     myMaterial.onLoadInit = function( material ) {
*         material.oneSide = false;    // double sided
*         material.smooth = true;        // smoothing
*     }
* credit to JLM at Justinfront DOT net for LoadArrayMaterials class

import org.papervision3d.materials.BitmapMaterial;
import com.dynamicflash.utils.Delegate;
import flash.geom.Rectangle;
import flash.display.BitmapData;

* The BitmapFileMaterial class creates a texture from an external file
class com.marcpelland.as2.papervision.materials.BitmapFileMaterial  {

// store the material info
private var __bitmapMaterial:BitmapMaterial;
public function get bitmapMaterial():BitmapMaterial {
return __bitmapMaterial;

private var __materialHolder_mc:MovieClip;    // holder for the material
private var __loadListener_obj:Object;        // load listener
private var __loader_mcl:MovieClipLoader;    // movie clip loader
private var __path:String;                    // file path

// set a separate load init function
private var __onLoadInit:Function;
public function set onLoadInit(ARG_func:Function):Void {
__onLoadInit = ARG_func;


function BitmapFileMaterial() {


* load image function
* @param ARG_filePath - path to the image file
* creates a clip holder, moves it off screen and loads
* the image into the holder
public function loadImage(ARG_filePath:String):Void {

// updates bitmap material ( designed to not overwrite material already assigned )
__materialHolder_mc = _root.createEmptyMovieClip( 'materialHolder__' + _root.getNextHighestDepth(), _root.getNextHighestDepth());

// place off screen
__materialHolder_mc._x = -5000;

// load the image into the holder
__loader_mcl.loadClip( ARG_filePath, __materialHolder_mc );



* init function
* initialize the loader
private function init():Void {

// set up the loader
__loader_mcl = new MovieClipLoader();

// set up the listener
__loadListener_obj = new Object();

// add the load int functionality
__loadListener_obj.onLoadInit = Delegate.create(this, loadInit);


* loadInit function
* the image has been loaded and all is ready to move on
private function loadInit():Void {

// get the material into a BitmapMaterial
__bitmapMaterial =  writeMaterial();

// run the custom load init command
__onLoadInit( __bitmapMaterial );


* write material function
* create a bitmap and copy the data from the movieclip
* to the bitmap, return the bitmap
private function writeMaterial():BitmapMaterial {

// draw movie on bitmap
var bitmap = new BitmapData(__materialHolder_mc._width, __materialHolder_mc._height, false, 0x000000);

var rectangle:Rectangle = new Rectangle(0 , 0, __materialHolder_mc._width, __materialHolder_mc._height );
bitmap.copyPixels( bitmap, rectangle, rectangle );

// assign material
var material_bm:BitmapMaterial = new BitmapMaterial(bitmap);

// remove the temp clip

return material_bm;


My first Papervision test

Well, I have been talking about it with friends and co-workers for the longest time but have never had the time to play with it. The other day I found a couple of hours to see what I could come up with. I decided to create a snowboard in 3ds max and see what I could do with it in Papervision, just going through a couple of tutorials.

I plan on improving on this as I find more time to get into both AS3 and Papervision. I am hopefully going to create a little flyout in max to automate and customize the creation of the board and then add a little bit more interactivity to the board once it is in flash.