I found the bug of Away3d. It doesn't work normally when UV is a
minus.

http://teraapi.com/away3dtmp/compare.png

Could anyone make the patch?

Example model (obj_Waku.as):

package {
        import away3d.core.*;
        import away3d.core.base.*;
//      import away3d.core.mesh.*;
//      import away3d.core.material.*;
        import away3d.core.utils.*;

        public class obj_Waku extends Mesh {
                private var ve:Array;
                private var fa:Array;

                public function obj_Waku(init:Object = null) {
                        super( init );
                        init = Init.parse(init);
                        ve = [];

                        v(100.000000,100.000000,-100.000000);
                        v(-100.000000,-100.000000,-100.000000);
                        v(100.000000,-100.000000,-100.000000);

                //      f(0,1,2,   /*UV0*/ 0.000000,-1.000000,  /*UV1*/
1.000000,-0.000000,   /*UV2*/0.000000,-0.000000,
0.000000,-0.000000,1.000000);        Broken UV
                        f(0,1,2,   /*UV0*/ 0.000000,0.000000,   /*UV1*/
1.000000,1.000000,    /*UV2*/0.000000,1.000000,
0.000000,-0.000000,1.000000);        //Correct UV, Y+=1.0


                        x = 0.000000; y = 0.000000; z = 0.000000;

                        rotationX = 0.000000; rotationY = -0.000000; rotationZ 
= 0.000000;

//                      this.scaleXYZ(1.000000, 1.000000, 1.000000);

                }
                public function v(x:Number, y:Number, z:Number):void {
                        ve.push(new Vertex(x, y, z));
                }

                public function f(vertexIndex1:int, vertexIndex2:int,
vertexIndex3:int, uv00:Number, uv01:Number, uv10:Number, uv11:Number,
uv20:Number, uv21:Number, normalx:Number, normaly:Number,
normalz:Number):void {
                        var face:Face = new Face( ve[vertexIndex1], 
ve[vertexIndex2], ve
[vertexIndex3], null, new UV(uv00, uv01), new UV(uv10, uv11), new UV
(uv20, uv21) );
                        addFace(face);
                }

                public function f2(vertexIndex1:int, vertexIndex2:int,
vertexIndex3:int):void {
                        addFace( new Face(ve[vertexIndex1], ve[vertexIndex2], ve
[vertexIndex3]) );
                }
        }
}

On 10月5日, 午前4:08, Fabrice3D <[email protected]> wrote:
> make sure your model is triangulated before export as 3ds or any other  
> format for Away3d
> Fabrice
>
> On Oct 4, 2009, at 3:51 AM, teraapi wrote:
>
>
>
> > Hi all,
>
> > UV breaks when 3ds is loaded. It repaired if it does very?
> > The model is a square, and all surfaces reverse.
>
> > Away3d: away3d_3_4_0.zip
> > IDE: Flex builder 3.02 (Flex SDK 3.4)
> > OS: Windows
> > Browser: Firefox 3.5.3
>
> > Source + 3DS Model (zipped):
> >http://teraapi.com/away3dtmp/src.zip
>
> > Source:
> >http://teraapi.com/away3dtmp/srcview/
>
> > Flash:
> >http://teraapi.com/away3dtmp/Main.html
>
> > Correct (using Blender):
> >http://teraapi.com/away3dtmp/correct.jpg
>
> > Thanks

Reply via email to