I have been using Away3D for a few months now and found this
discussion group to be an useful source of information. Here is a
small contribution back:

When using ownCanvas=true, there are problems with z-order and
rendering.

CORRECT_Z_ORDER & INTERSECTING_OBJECTS doesn't work on complex models.
I added this method to Object3D.as to workaround this issue.  This
method calculates the
absolute Z of the mesh in scene coordinates and sets its screenZOffset
accordingly.

public function adjustAbsZOrder():void
       {
        var m1:Matrix3D = _scene == this ? transform : sceneTransform;
        updateDimensions();

        var v:Vector3D  = new Vector3D((_minX + _maxX)/2 , (_minY +
_maxY)/2 , (_minZ + _maxZ)/2 );
        var tv:Vector3D = m1.transformVector(v);
        this.screenZOffset = tv.z;
       }


Call this method for all meshes before render(). If a Mesh changes
position or rotates, the method needs to be called again!

I also noticed that the distanceTo() method in Object3D does not use
the screen transformations, except for the position. So, when a Mesh
is rotated and moves closer to the target object, the
distanceTo(target) still produces the same value as before.

Transforming m1 & m2 using their positions (like in the code above)
before computing their dx/dy/dz works!

Hope this is of some help!

Thanks and keep up the good work Away team!!

Reply via email to