Well there is no reason z-sorting should encounter problems with the
setup that I'm using. It's nothing but four cubes of different depths,
with each cube standing at least 100 "distance" away from the others.
It doesn't always happen that z-sorting goes wrong, in fact, it's been
working like a charm today. So I'm convinced it's a bug somewhere. It
has to do with a combination of camera angle and materials on the cube
I think. But I've been having trouble re-creating it today.
Here is another bug I ran into today though:
package {
import away3d.containers.View3D;
import away3d.materials.WireframeMaterial;
import away3d.primitives.Cube;
import away3d.core.render.Renderer;
import flash.display.Sprite;
[SWF(width="500", height="400", frameRate="60",
backgroundColor="#FFFFFF")]
public class BugExample extends Sprite
{
public var view:View3D;
private var cube:Cube;
private var cube2:Cube;
public function BugExample()
{
view = new View3D({x:250,y:200,
renderer:Renderer.CORRECT_Z_ORDER});
addChild(view);
cube = new Cube();
cube2 = new Cube();
var outlineMaterial:WireframeMaterial = new
WireframeMaterial(0x000000);
outlineMaterial.thickness = 3;
cube2.outline = outlineMaterial;
cube.z = -300;
view.scene.addChild(cube);
view.scene.addChild(cube2);
view.render();
}
}
}
Both cubes have the same size, but the outline of the cube in the back
shows through the cube in the front. Simply a combination of
"renderer:Renderer.CORRECT_Z_ORDER" and outline causing this bug. The
outline of the cube in the back should not be visible. This is a z-
sorting bug I think.