Tutorial : Simple 360 Panorama with Papervision in AS2
How to make a simple 360 Panorama (quicktime VR like) with Papervision3D in AS2 ?
It’s very easy !
The first step : Getting Papervision
PaperVision3D is an open source project started by Carlos Ulloa. The most recent build of PaperVision can be retrieved from OSFlash’s Subversion Repository (SVN) here.
The second step : Everybody need a montage :p
You can find some quicktime VR export or your can make your own. Just think that you must at the end make a cube (6 faces) like this :

The last step : Dev
For a panorama you must export those6 faces of your cube in Bitmap and linked in your library. You can also load your face from external bitmap and make a bitmapData for each face.
Now you can realy start the dev.
- Make a empy movieclip and linked it to a class witch extended MovieClip class.
- Make a 3D Scene :
var scene:MovieScene3D = new MovieScene3D(this);
“this” is your empty movieclip
- Make a camera :
var camera:FreeCamera3D = new FreeCamera3D();
- Make 6 differents textures with each face of the cube :
var texture:BitmapAssetMaterial = new BitmapAssetMaterial("face1");
texture_b.oneSide = false;
the “face1″ is your linked name of your bitmap on your library.
The property “oneSide” is a property of a BitmapAssetMaterial. It’s make a two faces textures if you set it at false.
- For each 6 textures make 6 planes :
var plane1:Plane = new Plane(texture, widh_img, height_img, nbFaces, nbFaces);
The nb faces for a plane is very important because if you give a big number the 3D will be more precis but that make lag because it’s more informations wich must be treat by your processor.
- Push each plane to your scene :
scene.push(plane1);
- Place each plane to make a cube in 3D:
plane1.x = -wid_img/2;
plane1.z = 0;
plane1.rotationY =-90;
- Make a render to your camera :
scene.renderCamera(camera);
- That’s all ! Now you can apply a function in enterframe to make move your camera or your planes with the position of the mouse for example.
You can see the result here.
You can download the source here.
Enjoy It!!
Edit : http://blog.makemepulse.com/2007/10/10/how-to-retrieve-image-from-a-quicktime-vr-for-a-flash-panorama/ will help you for this panorama


6 Comments
Jump to comment form | comments rss [?] | trackback uri [?]