Hi,
There's a few issues in your code:
diffuseMaterial= loader.getBitmapData("pic1") as BitmapMaterial;
should be
diffuseMaterial= new BitmapMaterial( loader.getBitmapData("pic1") );
You can't cast BitmapData into a magical BitmapMaterial. You need to
create a material and pass its constructor or assign its bitmap
variable the BitmapData.
You override the materials by using cube.material = diffuseMaterial;
then cube.material = normalMaterial; and finally cube.material =
dot3Materials;
You obviously don't need diffuseMaterial or normalMaterial.
Cast.bitmap(diffuseMaterial) will not work. You can't cast a material
into BitmapData. If you need the BitmapData used by a material use
diffuseMaterial.bitmap.
Try something like:
dot3Materials = new
Dot3BitmapMaterial( loader.getBitmapData("pic1"),
loader.getBitmapData("pic2") );
cube.material = dot3Materials;
Always consult the ASDocs to learn what materials need as constructor
data:
http://away3d.com/livedocs/3.5.0_lib/away3d/materials/Dot3BitmapMaterial.html#Dot3BitmapMaterial()
Finally this shouldn't be in the render loop:
viewport.camera.z=-400;