Panoramic 360 with Papervision3d

Best Essay

Thesis Reading Service You can see here a screenshot of the resulting 3d object:

http://vinkenjagt.nl/?life-of-pi-essay-help Life Of Pi Essay Help

http://sankayaonline.com/buy-photography-business-plan/ Buy Photography Business Plan

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package
{
   import flash.display.*;
   import flash.events.*;
   import flash.geom.*;
   import flash.ui.*;
   import org.papervision3d.scenes.*;
   import org.papervision3d.objects.*;
   import org.papervision3d.cameras.*;
   import org.papervision3d.materials.*;
   import org.papervision3d.events.*;
   public class main extends Sprite
   {
      private var container:Sprite;
      private var scene:Scene3D;
      private var camera:FreeCamera3D;
      private var rootNode:DisplayObject3D;
      private var DaeMaterials:Object;
      private var center:Point;
      private var rotating:Boolean;
      private static var MAX_X_ROTATION:int = 12;
      private var keyRight   :Boolean = false;
      private var keyLeft    :Boolean = false;
      private var keyForward :Boolean = false;
      private var keyReverse :Boolean = false;
      public function main()
      {
         center = new Point(0,0);
         this.addEventListener( Event.ENTER_FRAME, loop3D );
         this.addEventListener( MouseEvent.MOUSE_DOWN, mouseDownHandler);
         this.addEventListener( MouseEvent.MOUSE_UP, mouseUpHandler);
         init3D();
      }
      private function mouseDownHandler(evt:MouseEvent):void
      {
         center.x = container.mouseX;
         center.y = container.mouseY;
         rotating = true;
      }
      private function mouseUpHandler(evt:MouseEvent):void
      {
         rotating = false;
      }
      private function init3D():void
      {
         this.container = new Sprite();
         addChild( this.container );
         this.container.x = stage.stageWidth/2;
         this.container.y = stage.stageHeight/2;
         this.scene = new Scene3D( this.container );
         camera = new FreeCamera3D();
         camera.x = 0
         camera.z = 0
         camera.zoom = 1;
         camera.focus = 200;
         DaeMaterials = new Object();
         var bmpMaterial:BitmapAssetMaterial = new BitmapAssetMaterial( "greece.jpg" );
         //var testMaterial:WireframeMaterial = new WireframeMaterial(0x000000, 100);
         //testMaterial.doubleSided = true;
         bmpMaterial.doubleSided  = true;
         DaeMaterials.mymaterial = bmpMaterial;
         rootNode = scene.addChild( new DisplayObject3D( "rootNode" ) );
         rootNode.addCollada( "sphere.dae", new MaterialsList( DaeMaterials ) );
      }
      private function loop3D( event :Event ):void
      {
         var sphere:DisplayObject3D = this.rootNode.getChildByName( "Sphere01" );
         if(sphere){
            if(rotating){
               camera.rotationY += (container.mouseX - center.x)/25
               camera.rotationX -= (container.mouseY - center.y)/25
               if(camera.rotationX > main.MAX_X_ROTATION) camera.rotationX = main.MAX_X_ROTATION
               if(camera.rotationX < -main.MAX_X_ROTATION) camera.rotationX = -main.MAX_X_ROTATION
            }
         }
         this.scene.renderCamera( camera );
      }
   }
}

http://www.stiuk.de/?does-homework-help-statistics Does Homework Help Statistics