Hi all,

Here is the exact code i have and it doesnt seem to work for me: I cant see
the point drawn.

private function mySphereMouseDownHandler(e:MouseEvent3D):void
{
 //so we first check if our object is a sphere
 if(e.object is Sphere)
 {
  //var theBit:Sprite = BitmapMaterial( Mesh(e.object).material).bitmap;
  var theBitmap:BitmapMaterial = BitmapMaterial(Mesh(e.object).material);

  var m:Matrix = new Matrix();

  m.translate(e.uv.u*theBitmap.width,(1-e.uv.v)*theBitmap.height);

  var canvas:BitmapData=new BitmapData(20,20,false,0x00000000);

  var s:Shape = new Shape();
  s.graphics.beginFill(0xcc00cc);
  s.graphics.drawRect(0,0,20,20);
  s.graphics.endFill();
  canvas.draw(s);

  theBitmap.bitmap.draw(canvas,m);
 }
}

also tried


  theBitmap.bitmap.draw(s,m);

and that doesnt work for me too.

I must be doing something wrong.

Cheers
Dan
On Fri, Oct 16, 2009 at 6:42 PM, ben <[email protected]> wrote:

>
> Hi Darko,
> try:
> var canvas:BitmapData=new BitmapData(20,20,true,0x0000000;
> m.translate(e.uv.u*theBitmap.bitmap.width,(1-e.uv.v)
> *theBitmap.bitmap.height);
>
> and you probably don't need to draw the shape once in a canvas, then
> this canvas in your BitmapMaterial, just :
> theBitmap.bitmap.draw(s,m);
> if you copy your canvas in the bitmapmateirl bitmap, better use
> copyPixels.




-- 
Radiceski Darko
University of Wollongong
Australia
SIFE - UOW Chapter - Alumni
CASUAL ACADEMIC STAFF TEACHING - UOW SITACS
(School of Information Technology and Computer Science,University of
Wollongong)
Univeristy of Wollongong - Alumni

Reply via email to