[Papervision3D] artifact
Roy Wiggins
bungadunga at gmail.com
Thu Feb 7 16:22:29 PST 2008
It's papervision's depth sorting algorithm; just subdivide the planes some
more, or move them further apart.
On Feb 7, 2008 2:45 PM, ilteris kaplan <ilteriskaplan at gmail.com> wrote:
>
> Hey can someone tell me what might be creating those artifacts? you have
> to
> click on the plane to see them. I would appreciate any feedback.
>
> http://share.klaweht.com/pv3d/artifacts/PlanesMove.html
>
> here's my source code.
>
>
> package {
> import caurina.transitions.Tweener;
> import caurina.transitions.properties.CurveModifiers;
>
> import flash.display.*;
> import flash.events.*;
> import flash.filters.*;
> import flash.text.*;
> import flash.utils.Dictionary;
>
> import org.papervision3d.cameras.FreeCamera3D;
> import org.papervision3d.events.InteractiveScene3DEvent;
> import org.papervision3d.materials.BitmapMaterial;
> import org.papervision3d.objects.DisplayObject3D;
> import org.papervision3d.objects.primitives.Plane;
> import org.papervision3d.scenes.Scene3D;
> import org.papervision3d.view.Viewport3D;
>
> public class PlaneManager {
>
> [Embed(source="blueGradient.jpg")] public var Imagex:Class;
> //[Embed(source="portrait.jpg")] public var Imagex:Class;
>
>
>
> private var planeDictionary :Dictionary = new Dictionary(true);
> private var planeArray:Array = new Array();
> private var planeContainerArray:Array = new Array();
>
> private var viewport:Viewport3D;
>
>
>
> private var camera:FreeCamera3D;
>
> private var reverse:Boolean;
>
> private var scene:Scene3D;
>
> private var totalWidth:Number;
> private var totalHeight:Number;
>
> private var pieceWidth:Number;
> private var pieceHeight:Number;
> private var numOfWidthPieces:Number;
> private var numOfHeightPieces:Number;
>
> private var t :DisplayObject3D;
> private var stage:Stage;
>
> private var planesArr:Array = new Array();
> private var planesMove:PlanesMove;
> public function PlaneManager(scene:Scene3D, camera_:FreeCamera3D,
> t_:DisplayObject3D,stage_:Stage, planesMove_:PlanesMove) {
> planesMove = planesMove_;
>
>
> totalWidth = 300;
> totalHeight = 400;
> pieceWidth = Math.round(totalWidth
> /numOfWidthPieces);
> pieceHeight = Math.round
> (totalHeight/numOfHeightPieces);
>
>
> t = t_;
> camera = camera_;
> stage = stage_;
>
> CurveModifiers.init();
> createPlanes(scene);
>
> }
>
> private function createPlanes(scene:Scene3D):void {
> var numOfPlanes:Number = 10;
> var data:Bitmap = new Imagex() as Bitmap;
> var material:BitmapMaterial = new
> BitmapMaterial(data.bitmapData);
> // var material:BitmapColorMaterial = new
> BitmapColorMaterial( 0xff33cc);
> material.doubleSided = true;
> //set the interactive property of your material
> to "true"
> material.interactive = true;
> for (var i:int = 0; i < numOfPlanes; i++) {
>
> var plane:Plane = new Plane(material,200,300);
> plane.y = -20;
> planesArr.push(plane);
>
> }
>
>
>
> planesArr[0].addEventListener(InteractiveScene3DEvent.OBJECT_CLICK,
> doThis);
>
>
>
>
> t.addChild( planesArr[0]);
> // t.addChild(myplane);
>
> // t.addChild(myplane2);
> scene.addChild(t);
>
> }
>
>
> private function doThis(e:Event):void {
> planesMove.stop = true;
> createMorePlanes();
>
> }
>
>
> private function createMorePlanes():void {
>
> turn90();
>
> }
>
> private function turn90():void {
> for (var i:int = 0; i < planesArr.length; i++) {
> Tweener.addTween(planesArr[i], {
> rotationX:-60,
> //rotationY:goto.rotationY,
> //rotationZ:goto.rotationZ,
> time:.2,
> transition:"easeOutQuad",
> onComplete:createRest
> });
> }
> }
>
> private function createRest():void {
>
>
> t.addChild(planesArr[0]);
>
>
> trace(planesArr.length);
> for (var i:int = 0; i < planesArr.length; i++) {
>
> t.addChild(planesArr[i]);
>
> Tweener.addTween(planesArr[planesArr.length-i], {
> z : 0,
> y:i*50,
> //rotationY:goto.rotationY,
> //rotationZ:goto.rotationZ,
> time:.5,
> transition:"easeOutQuad"
> });
> }
>
>
>
> planesMove.stop = false;
>
> }
>
>
>
>
>
>
>
>
>
> }
> }
>
>
>
> --
> View this message in context:
> http://www.nabble.com/artifact-tp15345415p15345415.html
> Sent from the Papervision3D mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20080207/f022b2d8/attachment.html
More information about the Papervision3D
mailing list