After reading Mike Downey’s post yesterday and checking out the 3D video carousel, I decided that this would be a good example to create to help me learn Papervision3D. The API couldn’t be easier to use and if you use the AS3 version it is lightening fast! Click on the image below to see the example. I embedded the FLV files so that there wouldn’t be buffering issues. It’s around 6 megs so just give it a chance to load. I’m so excited about Papervision3D! The AS3 is also shown below. Flash 9 player required!

[as]import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;

var sp:Sprite = new Sprite();
this.addChild(sp);
sp.x = 320;
sp.y = 200;

var radius:int = 800;

var s:Scene3D = new Scene3D(sp);
var cam:Camera3D = new Camera3D();
cam.z = -150;

var center:Plane = new Plane();
s.addChild(center);
center.visible = false;

var bmd:BitmapData = new BitmapData(320, 240);
var bmd2:BitmapData = new BitmapData(320, 240);
var bmd3:BitmapData = new BitmapData(320, 240);
var bmd4:BitmapData = new BitmapData(320, 240);

var mat1:BitmapMaterial = new BitmapMaterial(bmd);
mat1.oneSide = false;
var plane1:Plane = new Plane(mat1,320, 240, 5, 5);
plane1.x = Math.cos(Math.PI*2) * radius;
plane1.z = Math.sin(Math.PI*2) * radius;
plane1.rotationY = 270;

var mat2:BitmapMaterial = new BitmapMaterial(bmd2);
mat2.oneSide = false;
var plane2:Plane = new Plane(mat2,320, 240);
plane2.x = Math.cos(Math.PI/2) * radius;
plane2.z = Math.sin(Math.PI/2) * radius;
plane2.rotationY = 180;

var mat3:BitmapMaterial = new BitmapMaterial(bmd3);
mat3.oneSide = false;
var plane3:Plane = new Plane(mat3,320, 240);
plane3.x = Math.cos(Math.PI) * radius;
plane3.z = Math.sin(Math.PI) * radius;
plane3.rotationY = 90;

var mat4:BitmapMaterial = new BitmapMaterial(bmd4);
mat4.oneSide = false;
var plane4:Plane = new Plane(mat4,320, 240);
plane4.x = Math.cos(Math.PI*1.5) * radius;
plane4.z = Math.sin(Math.PI*1.5) * radius;
plane4.rotationY = 0;

s.addChild(plane1);
s.addChild(plane2);
s.addChild(plane3);
s.addChild(plane4);

this.addEventListener(Event.ENTER_FRAME, render);

var angle:Number = 0;

function render(e:Event)
{
angle += (this.mouseX – 320) * 0.001;
cam.x = Math.cos(angle) * 900;
cam.z = Math.sin(angle) * 900;
cam.target = center;
bmd.draw(vid1.v);
bmd2.draw(vid2.v);
bmd3.draw(vid3.v);
bmd4.draw(vid4.v);
mat1.updateBitmap();
mat2.updateBitmap();
mat3.updateBitmap();
mat4.updateBitmap();
s.renderCamera(cam);
}

vid1.visible = false;
vid2.visible = false;
vid3.visible = false;
vid4.visible = false;[/as]

Lee