just look at constructor of the dot3d material: it requires 2 bitmapdata's

now, in your code you make a bitmapMaterial and you pass it to the constructor of the dot3...

try:
var bmd:Bitmapdata = generateFromLib("checker");

--> i assume you have a movieClip with linkage name checker with an image in it.
trace(bmd.width); --> if nothing or error you have linkage error

if you set a linkage name on your bitmapdata in your library
var bmd: BitmapData = new checker(w,h);
trace again, to make sure

you also can directly cast it in the constructor
var mat:Dot3BitmapMaterial = new Dot3BitmapMaterial(Cast.bitmap("checker"), mapgen.normalmap);

if you use generateFrom lib
you can do if you use var as above
var mat:Dot3BitmapMaterial = new Dot3BitmapMaterial(bmd, mapgen.normalmap);

or directly into constructor
var mat:Dot3BitmapMaterial = new Dot3BitmapMaterial(generateFromLib("checker"), mapgen.normalmap);

if you use linkage on bitmap
var mat:Dot3BitmapMaterial = new Dot3BitmapMaterial(new checker(w,h) as BitmapData, mapgen.normalmap);


remember that the normalmap is available only AFTER the constructor of the normalmap generator has been instanciated
and it will react on the light only AFTER its fully traced.


Fabrice


On Jun 28, 2009, at 4:00 PM, DesignByLefty wrote:


i'm going nuts.

i've tried with both

var bmat=new BitmapMaterial(Cast.bitmap("checker"),{smooth:true});
var bmat:IMaterial = new BitmapMaterial(generateFromLib("checker"));

var mat:Dot3BitmapMaterial=new Dot3BitmapMaterial
(bmat,mapgen.normalmap);

(not at the same times)

and have for seconde bmat this error
1067: Implicit coercion of a value of type away3d.materials:IMaterial
to an unrelated type flash.display:BitmapData.

Reply via email to