thcmedia / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

Overlapping planes rendering artifacts #117

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Set up some parallel planes or cubes in a DisplayObject3D
2. rotate the  DisplayObject 
3. Look for anomalies appearing in the rendering.  Some of the color form 
the hidden plane shows through at odd angles.

Code example below.  Screen shot attached.

What is the expected output? What do you see instead?
I didn't expect to see rendering problems. Two straight forward parallel 
planes.  Not one that had a potion of the other plane showing through.

What version of the product are you using? On what operating system?
I scync'd again today, 10-16-08 and had the same problem.  WinXP.

Please provide any additional information below.

package
{
    import flash.display.Sprite;
    import flash.events.Event;

    import org.papervision3d.cameras.Camera3D;
    import org.papervision3d.materials.ColorMaterial;
    import org.papervision3d.materials.utils.MaterialsList;
    import org.papervision3d.objects.DisplayObject3D;
    import org.papervision3d.objects.primitives.Cube;
    import org.papervision3d.objects.primitives.Plane;
    import org.papervision3d.render.BasicRenderEngine;
    import org.papervision3d.scenes.Scene3D;
    import org.papervision3d.view.Viewport3D; 

    public class Main extends Sprite
    {        
        private var viewport:Viewport3D;        
        private var scene:Scene3D;        
        private var camera:Camera3D;        
        private var renderer:BasicRenderEngine; 

        private var mydo:DisplayObject3D;

        public function Main()
        {   
            this.addEventListener(Event.ENTER_FRAME, 
myEnterFrame);            
            initPapervision3D();      
        } 

        private function initPapervision3D():void
        {               
            viewport = new Viewport3D();               
            addChild(viewport);               
            scene = new Scene3D();   
            camera = new Camera3D();                    

            var plane1material:ColorMaterial = new 
ColorMaterial(0xff0000);
            plane1material.doubleSided = true;

            var plane2material:ColorMaterial = new 
ColorMaterial(0xffffff);
            plane2material.doubleSided = true;

            var plane1:Plane = new Plane(plane1material, 500, 
500);
            var plane2:Plane = new Plane(plane2material, 300, 
300 );
            plane2.z = 40;  
            mydo = new DisplayObject3D();
            mydo.addChild(plane1);
            mydo.addChild(plane2);       
            scene.addChild(mydo);   
            renderer = new BasicRenderEngine();              
        }  

        private function myEnterFrame(event:Event):void
        {
            mydo.rotationX += 3.3;          
            renderer.renderScene(scene, camera, viewport);  

        }
    }
}

Original issue reported on code.google.com by deana...@yahoo.com on 16 Oct 2008 at 9:20

Attachments:

GoogleCodeExporter commented 8 years ago
This is not really a bug, rather expected as by using the painters algorithm. A 
fix
is to set the planes in their own containers, or use a quadtree renderer.

Original comment by r.hauw...@gmail.com on 17 Oct 2008 at 1:47