I am trying to build a cube with Away3D 4. I need to manager material on each side of the cube, so, I trying to apply the SkyBoxMaterial to the Mesh with this code :
var w:Number = 580, h:Number = 580, d:Number = 580;
var pageTexture1:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/11.swf", null, 1, 1, 512, 512, null, false);
var pageTexture2:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/12.swf", null, 1, 1, 512, 512, null, false);
var pageTexture3:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/13.swf", null, 1, 1, 512, 512, null, false);
var pageTexture4:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/14.swf", null, 1, 1, 512, 512, null, false);
var pageTexture5:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/15.swf", null, 1, 1, 512, 512, null, false);
var pageTexture6:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/16.swf", null, 1, 1, 512, 512, null, false);
var bitmapTexture:BitmapData = new BitmapData(w, h, true, 0xEEFF0000);
_cubeMaterial = new SkyBoxMaterial(new PageCubeTexture(pageTexture1, pageTexture2, pageTexture3, pageTexture4, pageTexture5, pageTexture6));
_cubeMaterial.lightPicker = lightPicker;
_cube = new Mesh(new CubeGeometry(w, h, d, 1, 1, 1, true), _cubeMaterial);
PageCubeTexture and PageTexture are in the attached in the attachments.
It seems OK is w equals to h equals to d. But if w, h, d not equals to each other, the texture all goes wrong
Is this a bug? How can I fix this problem?
Thank you!