how do I create a model with an embeded model.3ds?

Software: Away3D 4.x

edgar, Member
Posted: 15 December 2011 04:12 PM   Total Posts: 52

I know how to create a model with the loader class, loading the model.3ds.
But how do I create this model with an embedded file
[Embed(source(“assets/model.3ds, ,mimeType=“application/octet-stream”)]
private var Model:Class;

....???


And how do I create this model with a model class (model.as)?

Thanks
Edgar

   

Avatar
Matse, Sr. Member
Posted: 15 December 2011 07:47 PM   Total Posts: 149   [ # 1 ]

Quick reply, you’ll have to enable the 3DS parser

AssetLibrary.enableParser(Max3DSParser); 

then you load it through the AssetLibrary, you can probably use the parser directly if you prefer, I like the assetLibrary as I can use the nameSpace parameter when loading to rename the asset once its loaded.

AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETEonAssetComplete);  
AssetLibrary.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
AssetLibrary.addEventListener(LoaderEvent.LOAD_ERRORonLoadError);

AssetLibrary.loadData(Modelnull"test model"); 

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X