Immersive 360° Video

Setting up the Papervision3D world. Create a Sphere and position the camera inside it.


view = new BasicView( stage.stageWidth, stage.stageHeight, true, false );
view.camera.zoom = 1;
view.camera.focus = 500;
addChild( view );

//var demo3DObj:Plane = new Plane( new WireframeMaterial(), 50,50);
var demo3DObj:Sphere = new Sphere( new BitmapMaterial( bmp ), 200, 12, 12 );
demo3DObj.material.doubleSided = true;
demo3DObj.material.smooth = true;
demo3DObj.material.lineAlpha = 0.05;
demo3DObj.material.lineColor = 0xffffff;
demo3DObj.material.lineThickness = 1;
demo3DObj.scaleZ *= -1;
//view.scene.addChild(demo3DObj, "demo3DObj");

//panovid = new Sphere( new BitmapMaterial(bmp) ,700,40,40);
var panovid:Sphere = new Sphere( new BitmapMaterial( bmp ), 1700, 40, 40 );
panovid.material.doubleSided = true;
panovid.material.smooth = true;
panovid.material.lineAlpha = 0.05;
panovid.material.lineColor = 0xffffff;
panovid.material.lineThickness = 1;
//panovid.scaleY *=-1;
panovid.yaw( 90 );
view.scene.addChild( panovid, "panovid" );
                    

Now render the video to texture used on the sphere


bmp.draw( video );

view.scene.getChildByName( "panovid" ).yaw( (( (stage.stageWidth / 2) - stage.mouseX) / 50 ) * 1 );

Camera3D( view.camera ).hover( 0, view.viewport.containerSprite.mouseX * 0, view.viewport.containerSprite.mouseY * -.02 );

view.singleRender();