Using copyPixels to create BitmapData for Cube face BitmapMaterial

Software: Away3D Lite

eco_bach, Jr. Member
Posted: 12 October 2011 09:03 PM   Total Posts: 35

Hi
I have a number of cubes touching each other to form a seamless surface. I am trying to apply a single image across the front faces of these cubes so it appears seamless.

I am using copyPixels to first ‘slice’ the source bitmapdata BEFORE I apply it to each of the cube front faces.

it seems to work, no compile errors, however, the final bitmapData on each of the faces is scaled WAY too large for some strange reason. Each cube face image seems large and blurred.
Copy pixels is straightforward, can’t see why this isn’t working.

Can’t see anything wrong with my code…pulling my hair out…any help appreciated!!!

//CODE START

var _myFrontBMD:BitmapData
var _myFrontBM:BitmapMaterial

//following in a loop, xValue and yValue defined on each iteration
var rect:Rectangle = new Rectangle(xValue, yValue, 30, 30);
var bmd2:BitmapData = new BitmapData(30, 30, false);
var pt:Point = new Point(0, 0);
bmd2.copyPixels(_myFrontBMD, rect, pt);
_myFrontBM=new BitmapMaterial(bmd2);
myCube.faces[0].material =_myFrontBM;
//end loop

//CODE END

   

hfeist, Jr. Member
Posted: 28 June 2013 12:04 AM   Total Posts: 37   [ # 1 ]

Did you ever solve this?  I’ve posted a similar request for help.
I imagine your code here is from 4.0 or so it’s that long ago.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X