Hi,
I would like to have a cube with different materials on each side. This never really was a problem, but now I’ve got this strange thing that only two of the 6 materials are shown on all the sides (1 for the top, bottom, back, front and 1 for the left and right side). I can’t see what I’m doing wrong..
I created a cube with Away3dPhysics:
physics = new Away3DPhysics(view,4)
Then I create an array with the textures, where dicetexture1 to 10 are Bitmaps.
var diceTextures:Array = [ new BitmapMaterial( new diceTexture1(0,0)),
new BitmapMaterial( new diceTexture2(0,0)),
new BitmapMaterial( new diceTexture3(0,0)),
new BitmapMaterial( new diceTexture5(0,0) ),
new BitmapMaterial( new diceTexture4(0,0) ),
new BitmapMaterial( new diceTexture6(0,0)) ]
Then I create the cube:
dice = physics.createCube({width:diceScale, height:diceScale, depth:diceScale,segmentsW:1, segmentsH:1});
dice.movable=true
And finally assign the materials.
Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.left = diceTextures[0]
Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.right = diceTextures[1]
Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.front = diceTextures[2];
Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.back = diceTextures[3];
Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.top = diceTextures[4];
Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.bottom = diceTextures[5];
I can’t see what is going wrong. I should see a different letter on each side, but all I see is the V and the D.
I’m using 3.6.