If you haven't heard from the whole Flash community Papervision 3D 2.0 is out w/ textures, more interactive features and new coding conventions like BasicRenderEngine Class. I was working on a Coverflow thing for a client a week ago that I abandoned and just moded Doug McCune. But when I was going to do it myself I was using the Great White Trunk.
Here is what I came up with:
Actionscript:
-
package
-
{
-
-
import caurina.transitions.Tweener;
-
-
import flash.display.*;
-
import flash.events.Event;
-
-
import org.papervision3d.cameras.*;
-
import org.papervision3d.materials.*;
-
import org.papervision3d.objects.*;
-
import org.papervision3d.objects.primitives.*;
-
import org.papervision3d.render.BasicRenderEngine;
-
import org.papervision3d.scenes.*;
-
import org.papervision3d.view.Viewport3D;;
-
-
public class PV3DTest extends Sprite
-
{
-
[Embed(source="images/one.jpg")]
-
private var Pic:Class;
-
-
public var scene:Scene3D;
-
public var camera:Camera3D;
-
public var viewport:Viewport3D;
-
public var renderer:BasicRenderEngine;
-
private var photoContainer:Plane;
-
-
public function PV3DTest()
-
{
-
stage.scaleMode = StageScaleMode.NO_SCALE;
-
stage.align = StageAlign.TOP_LEFT;
-
init();
-
}
-
-
private function init():void
-
{
-
scene = new Scene3D()
-
camera = new Camera3D();
-
camera.focus = 500;
-
camera.zoom = 3;
-
-
renderer = new BasicRenderEngine();
-
-
viewport = new Viewport3D(stage.stageWidth, stage.stageHeight, false, false, true, true);
-
viewport.addEventListener(Event.ADDED_TO_STAGE, init3d);
-
addChild(viewport);
-
}
-
-
private function init3d(e:Event = null):void
-
{
-
var data:Bitmap;
-
var photoMat:BitmapMaterial;
-
-
data = new Pic() as Bitmap;
-
-
photoMat = new BitmapMaterial(data.bitmapData);
-
photoContainer = new Plane(photoMat, 220, 210, 6, 6);
-
camera.target = photoContainer;
-
//photoContainer.yaw(45);
-
-
scene.addChild(photoContainer);
-
renderer.renderScene(scene, camera, viewport);
-
addEventListener(Event.ENTER_FRAME, render);
-
}
-
-
private function render(evt:Event):void
-
{
-
Tweener.addTween(photoContainer, {rotationY: 45, transition:"linear", time:.5});
-
Tweener.addTween(viewport, {x: 300, transition:"linear", time:.5});
-
renderer.renderScene(scene, camera, viewport);
-
}
-
-
}
-
}
Last 5 posts in as3
- Flash Player 10 Pure Flash Keyboard using SampleDataEvent - September 3rd, 2008
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
- How to load Pixel Bender in Flash Player 10 - May 19th, 2008
- How to compile and examples for Flash Player 10 or ASTRO BETA - May 16th, 2008
Last 5 posts in flash
- Flash Player 10 Pure Flash Keyboard using SampleDataEvent - September 3rd, 2008
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
- How to load Pixel Bender in Flash Player 10 - May 19th, 2008
- How to compile and examples for Flash Player 10 or ASTRO BETA - May 16th, 2008
Last 5 posts in Flex
- Adobe Evangelist Daniel Dura visits Travelocity - April 15th, 2008
- Yahoo Maps ActionScript 3.0 Released - February 11th, 2008
- Tidbit #3 - testing additions to your code - Control Variable - November 28th, 2007
- Flash/Flex Tidbit #1 - October 18th, 2007
- How to set up and get WebOrb communication with Flex 2 with no service-config.xml - October 1st, 2007
Last 5 posts in papervision3D
- How to make a Rotating Cube in Papervision 3d - October 20th, 2007
Josh Weatherspoon, A self-proclaimed millionaire who for some reason has to work as a Flash Developer, at Travelocity in Dallas(Southlake), TX.
Sorry, no comments yet.