Thanks for helping Fabrice.

Could you elaborate on scaleX -1 and also the bit about looping over
the verices and changing them?

The AS3 Class that was exported from Blender currently looks like
this:

package  {
        import away3d.core.base.Face;
        import away3d.core.base.Mesh;
        import away3d.core.base.UV;
        import away3d.core.base.Vertex;
        import away3d.core.utils.Init;

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

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

                        v(1.000,1.000,-1.000);
                        v(1.000,-1.000,-1.000);
                        v(-1.000,-1.000,-1.000);
                        v(-1.000,1.000,-1.000);
                        v(1.000,1.000,1.000);
                        v(1.000,-1.000,1.000);
                        v(-1.000,-1.000,1.000);
                        v(-1.000,1.000,1.000);

                        
f(4,0,3,0.750,0.500,0.500,0.500,0.500,0.250,0.000,1.000,0.000);
                        
f(4,3,7,0.750,0.500,0.500,0.250,0.750,0.250,0.000,1.000,0.000);
                        
f(2,6,7,1.000,0.000,1.000,0.250,0.750,0.250,-1.000,0.000,-0.000);
                        
f(2,7,3,1.000,0.000,0.750,0.250,0.750,0.000,-1.000,0.000,-0.000);
                        
f(1,5,2,0.250,0.500,0.000,0.500,0.250,0.250,-0.000,-1.000,-0.000);
                        
f(5,6,2,0.000,0.500,0.000,0.250,0.250,0.250,-0.000,-1.000,0.000);
                        
f(0,4,1,0.750,0.750,0.750,0.500,1.000,0.750,1.000,0.000,-0.000);
                        
f(4,5,1,0.750,0.500,1.000,0.500,1.000,0.750,1.000,-0.000,0.000);
                        
f(4,7,5,0.750,0.500,0.750,0.250,1.000,0.500,-0.000,-0.000,1.000);
                        
f(7,6,5,0.750,0.250,1.000,0.250,1.000,0.500,0.000,-0.000,1.000);
                        
f(0,1,2,0.500,0.500,0.250,0.500,0.250,0.250,0.000,0.000,-1.000);
                        
f(0,2,3,0.500,0.500,0.250,0.250,0.500,0.250,0.000,-0.000,-1.000);


                        x = 0.000; y = 0.000; z = 0.000;

                        rotationX = 0.000; rotationY = -0.000; rotationZ = 
0.000;

                        scaleX = 1.000; scaleY = 1.000; scaleZ = 1.000;
                }
                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]) );
                }

        }
}



Thanks again!

On Jan 31, 8:29 pm, Fabrice3D <[email protected]> wrote:
> Its a right handed to left handed system issue.
> You have many ways to fix, like scaleX -1, loop over your vertices and change 
> them by u = 1-1 ,v = 1-v
> invert in photoshop, invert your mapping in Prefab or Blender etc...
>
> Fabrice
> On Jan 31, 2010, at 3:41 PM, jonny wrote:
>
>
>
> > Hi,
> > I have begun learning away3d and having a problem with my blender
> > object. Basically it's a simple cube which I have done a uv unwrap on
> > and placed an image texture on it. When I render it within blender,
> > everything looks correct(it's just a cube with numbers 1-6 on each
> > face) I then use the as3 exporter to create an as3 class which I have
> > added into my away3d project. The problem is that when I play the swf,
> > the texture is being applied to the wrong sides of each face, so it's
> > is being applied to the inside of the cube.
> > Now, I have read tons of forums which say that this problem is to do
> > with the normals being inverted within blender. But, I have turned on
> > the normals in blender and can clearly see that all normals are
> > pointing outwards (I.e the correct direction) and when I render from
> > within blender it looks correct so I don't understand why away3d is
> > inverting the texture.
> > I would be so grateful if anyone is able to help me with this as i
> > have spent weeks pulling my hair out on this and cannot find an
> > answer.
> > Many Thanks!- Hide quoted text -
>
> - Show quoted text -

Reply via email to