Thanks !
Latcho

Rob Bateman wrote:
Hey Tommy

this bug is now fixed, please check the trunk for updates!

cheers

Rob


On Wed, Apr 15, 2009 at 8:57 PM, Latcho <[email protected] <mailto:[email protected]>> wrote:

    Hi,
    Maybe related to Tommy's phong  problem.
    since the textfieldbranch still has the old cube I downed the
    latest fllash 9 build from the site to increase segments of the cube;
    I did this because the phong looked sucky wit the 2 big triangles
    on the front.
    when I applied phong I get also weird results.
    After some testing it turned out that when I zeroo'ed all light
    coordinates to zero, the phong material looked better.

    But still when zeroed,the light looks like the specular shininess
    is lost (on the cube.
    Here a demo which decreases light.x till zero.
    Watch the weird phong go better in 100 frames.

    Latcho


    package
    {
        import away3d.cameras.Camera3D;
        import away3d.core.math.Number3D;
        import away3d.core.render.Renderer;
        import away3d.lights.DirectionalLight3D;
        import away3d.lights.PointLight3D;
        import away3d.materials.*;
        import away3d.primitives.Cube;
        import away3d.primitives.data.CubeMaterialsData;
import flash.display.Sprite;
        import flash.events.Event;

        import away3d.containers.Scene3D;
        import away3d.containers.View3D;


        public class CubePhong extends Sprite
        {
protected var _scene3D:Scene3D;
            protected var _mainView3D:View3D;
            protected var _cam3D:Camera3D;
            private var light:DirectionalLight3D;
public function CubePhong ()
            {
                this.addEventListener(Event.ADDED_TO_STAGE, init);
            }
private function init(e:Event):void
            {
                environnement3D();
                cast3D();
                this.addEventListener(Event.ENTER_FRAME, render);
                animate();
            }
private function animate():void
            {
} private function cast3D():void
            {
var mat:PhongColorMaterial = new
    PhongColorMaterial(0xFF0000,{shininess : 1,specular : 1});
                var cube:Cube = new Cube( { width:200, height:200,
    depth:30, name:'cube3D',ownCanvas:true,z:50,material:mat } );
                cube.movePivot(cube.objectWidth / 2 ,
    -cube.objectHeight/2, cube.pivotPoint.z);
                cube.segmentsH = 5
                cube.segmentsW = 5

                _scene3D.addChild(cube);
            }
private function environnement3D():void
            {
                _scene3D = new Scene3D();
_cam3D = new Camera3D();
                _cam3D.lookAt(new Number3D(0, 0, 0));
                _cam3D.focus = 80;
                _cam3D.zoom = 6;
                _cam3D.z = 0 - ( _cam3D.focus * (_cam3D.zoom - 1)  );
_mainView3D = new View3D();
                _mainView3D.scene = _scene3D;
                _mainView3D.camera = _cam3D;
                _mainView3D.x = 648/2;
                _mainView3D.y = 526/2;
//_mainView3D.renderer = Renderer.CORRECT_Z_ORDER; light = new DirectionalLight3D({color:0xFFFFFF,
    ambient:0.8, diffuse:0.5, specular:0.6});
                light.x = 200;
                light.z = 0;
                light.y = 0;
                _scene3D.addChild(light);

                addChild(_mainView3D);
                _mainView3D.scene.addChild(light);
} private function render(e:Event):void
            {
                _mainView3D.render();
                _scene3D.getChildByName('cube3D').updateObject()
                _scene3D.getChildByName('cube3D').rotationX+=2
                _scene3D.getChildByName('cube3D').rotationY+=2
if (light.x > 0) {
                    light.x--
                }else {
                    trace("LIGHT.X =  ZERO");
                }
            }
        }
    }






    Rob Bateman wrote:
    Hey Tommy

    sorry for the problem you've encountered with the update - the
    solution is not obvious from here, so can you let us know a
    little more about how you are rendering the object?

    are there multiple materials on the object?
    are you using ownCanvas at all?
    are you using pushfront or pushback on the mesh?

    ultimately the best way to solve this would be to send a copy of
    your model over for us to test independently. However, if this is
    not possible, you could try replicating the bug with a different
    model and send it over as a test case so that we can debug


    cheers!

    Rob


    On Wed, Apr 8, 2009 at 11:22 PM, serioustommy
    <[email protected] <mailto:[email protected]>> wrote:


        Sorry for this but has anyone else encountered this?

        thanks,
        Tommy

        On Apr 3, 2:49 pm, serioustommy <[email protected]
        <mailto:[email protected]>> wrote:
        > Hi,
        >
        > I'm having weird z-sorting issues when I apply
        PhongBitmapMaterial as
        > the texture to a Collada model. The issue happens in all
        the latest
        > versions of Aways3D, but is ok if I revert back to build
        1057 on SVN
        > (incidentally right before the "committed initial 2.3
        version" SVN
        > comment, so that might have broken it somehow?).
        >
        > Working in svn build
        
1057:http://www.michellechuang.com/temp/3dtest/rc/good.pnghttp://www.michellechuang.com/temp/3dtest/rc/good2.png
        >
        > Not working in
        
2.3.3:http://www.michellechuang.com/temp/3dtest/rc/bad.pnghttp://www.michellechuang.com/temp/3dtest/rc/bad2.png
        >
        > As you can see it appears that the shaded legs are rendered
        in from of
        > the skirt and the bottom of the hair somehow comes forward
        as well.
        >
        > If I just use BitmapMaterial without any shading then it's
        fine.
        >
        > Anyone has any ideas on this issue?
        >
        > Many thanks!
        > Tommy




-- Rob Bateman
    Flash Development & Consultancy

    [email protected] <mailto:[email protected]>
    www.infiniteturtles.co.uk <http://www.infiniteturtles.co.uk>
    www.away3d.com <http://www.away3d.com>




--
Rob Bateman
Flash Development & Consultancy

[email protected] <mailto:[email protected]>
www.infiniteturtles.co.uk <http://www.infiniteturtles.co.uk>
www.away3d.com <http://www.away3d.com>

Reply via email to