Hi Ben,

Appreciate your time and help.

This is the exact code i have:

private function onEnterFrame(e:Event):void
{
 if(!cover.visible)
 {
  trace(lastKey);

  if(keyIsDown){
   // if the key is still pressed, just keep on moving
   switch(lastKey){
   }
  }
  // render the view
  cam.hover();
  View.render();
 }
}

private function InitDisplayObject():void
{
 theTexture = new BitmapFileMaterial("panorama.jpg");
 // add a huge surrounding sphere so we really can see what we're doing
 largeSphere = new
Sphere({radius:1500,material:theTexture,segmentsW:14,segmentsH:28});
 //largeSphere.invertFaces();

 largeSphere.scaleX = -1;
 View.scene.addChild(largeSphere);
}


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);
 }
}

The rendering is done in the OnFrameEnterHandler.

Any advice.

Once more thank you for your help.

Sincerely
Dan



On Sat, Oct 17, 2009 at 9:47 PM, ben <[email protected]> wrote:

>
> Darko, I should have an exemple with bitmapMaterial, instead of
> moviematerial.
> The difference is that the moviematerial is updated automatically,
> thats why it's better to use it...
>
> Found the exemple, and I'm just doin nothing different...
> well are you rendering your scene after drawing ??
>
> try to :
> create a bitmapdata fisrt, keep it in reference, then pass it to the
> bitmapmaterial,
> apply your bitmapmaterial to your object,
> then draw in your bitmapdata.
> then try to set the material again to the object.
> this should update it.
>
> but tell me how did you create your bitmapMaterial ?
>
>
>
>
>


-- 
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