Updating Bitmap?

Software: Away3D 3.x

dmen, Newbie
Posted: 21 August 2011 09:37 PM   Total Posts: 11

I was using a TransformBitmapMaterial like so:

mat = new TransformBitmapMaterial(new baseMap());

and was able to update the bitmapData in real time using something like:

mat.bitmap = appliedMap;

I decided to try a phong material and simply did:

mat = new PhongBitmapMaterial(new baseMap());

It works except setting mat.bitmap no longer does anything. Also tried with EnviroBitmapMaterial and the same thing - the bitmap doesn’t update when I set the bitmap property later.

What am I doing wrong?

   

Somokon, Member
Posted: 22 August 2011 03:50 AM   Total Posts: 75   [ # 1 ]

Try calling mat.updateTexture() after changing the bitmap data

   

dmen, Newbie
Posted: 22 August 2011 11:12 AM   Total Posts: 11   [ # 2 ]

Yes, the view is being updated, but thanks.

I will try calling updateTexture() but I still am wondering why TransformBitmap material worked without having to do that? As all the bitmap materials extend BitmapMaterial, I’d think just setting .bitmap would do the trick. Bugs me that it isn’t consistent…

   

dmen, Newbie
Posted: 22 August 2011 01:46 PM   Total Posts: 11   [ # 3 ]

Hmm, getting a 1061 error - undefined method when calling mat.updateTexture()

Also, I don’t see updateTexture defined in any of the classes that PhongBitmapMaterial inherits from.

Any thoughts?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X