help to understand how parsers work!!

Software: Away3D 4.x

charlito, Jr. Member
Posted: 12 April 2012 11:33 AM   Total Posts: 36

Hi..

from github, i saw how to import a model into my scene.. it was really cool, when i saw it in my scene..
but when i tried to import 2 diferents models, i got only one mesh wich has both models blended.
i end it up having one really cool fly-gun.  < the one i attached.  smile  >

as i was playing with my code.. i saw that

public function init_3dModels():void
      {
      Parsers
.enableAllBundled();
      
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE,     onAssetComplete);
      
AssetLibrary.loadData(new gun3d());
      
}

private function onAssetComplete(event:AssetEvent):void
 {
 btGun 
= new BitmapTexture(new jpg_gun().bitmapData);
 
tGun = new TextureMaterial(btGun);
   
 if (
event.asset.assetType == AssetType.MESH{
  m3dGun
event.asset as Mesh;
  
m3dGun.material tGun;
  
m3dGun.geometry.scale(4);
  
tGun.normalMap = new BitmapTexture(new jpg_gun().bitmapData);
  
tGun.lightPicker luz_picker;
  
tGun.gloss 10;
  
tGun.specular 3;
  
tGun.ambientColor 0x303040;
  
tGun.ambient 3;

  
ocGun.addChild(m3dGun);
  
ocGun.z=40;
  
ocGun.y=-55;
  
ocGun.x=15;

/*btFly = new BitmapTexture(new jpg_fly().bitmapData);
  tFly = new TextureMaterial(btFly);
  m3dFly = event.asset as Mesh;
  m3dFly.material = tFly;
  m3dFly.geometry.scale(4);
 */

so.. how can i have embeded 2 diferents models each with their own mesh and texture?

thx a lot. in advance.

smile

 

 

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X