Here is another Papervision3D example. This time I am extending a 3D carousel on the Y axis to create a spiral. There are 100 planes and the spiral rotates around 5 times. The Y of your mouse controls the Y of the spiral and the X position of the mouse controls the rotation. This could probably be useful for some type of list and it is at least somewhat different than the typical carousel.
Actionscript:
- import org.papervision3d.scenes.*;
- import org.papervision3d.cameras.*;
- import org.papervision3d.objects.*;
- import org.papervision3d.materials.*;
-
- // Create the container sprite
- var con:Sprite = new Sprite();
- con.x = stage.stageWidth * 0.5;
- con.y = stage.stageHeight * 0.5;
- addChild(con);
-
- // Setup the scene
- var scene:Scene3D = new Scene3D(con);
- var cam:Camera3D = new Camera3D();
- cam.zoom = 4;
-
- // Create camera center
- var pc:Plane = new Plane();
- pc.visible = false;
- cam.target = pc;
-
- // Spiral properties
- var num:int = 100;
- var numOfRotations:Number = 5;
- var anglePer:Number = ((Math.PI*2) * numOfRotations) / num;
- var yPos:Number = 0;
-
- // Create the planes
- var pa:Array = new Array();
- for(var i:uint=0; i<num ; i++)
- {
- var cm:BitmapAssetMaterial = new BitmapAssetMaterial("air");
- cm.oneSide = false;
- var p:Plane = new Plane(cm, 100, 100);
- p.x = Math.cos(i * anglePer) * 550;
- p.z = Math.sin(i * anglePer) * 550;
- p.y = yPos += 50;
- p.rotationY = (-i*anglePer) * (180/Math.PI) + 270;
- scene.addChild(p);
- }
-
- // Create the render loop
- addEventListener(Event.ENTER_FRAME, render);
-
- var angle:Number = 0;
-
- function render(e:Event):void
- {
- var dist:Number = ((stage.mouseY) - stage.stageHeight * 0.5) * -0.1;
- var dist2:Number = ((stage.mouseX) - stage.stageWidth * 0.5) * 0.0005;
- angle += dist2;
- cam.x = Math.cos(angle) * 1000;
- cam.z = Math.sin(angle) * 1000;
- cam.y += dist;
- if(cam.y <369) cam.y = 369;
- if(cam.y> 4755) cam.y = 4755;
- pc.y = cam.y;
- scene.renderCamera(cam);
- }

