Hello and thanks that worked perfectly.  The answer is always to
simple, thank you so much you saved me so much time, it may have taken
me months to finally figure that I needed to make a new material and
give it the loaded bitmap data. Thanks again. -CB

On Jul 27, 1:35 pm, elguapoloco <[email protected]>
wrote:
> 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/Dot3BitmapMater...()
>
> Finally this shouldn't be in the render loop:
>  viewport.camera.z=-400;

Reply via email to