Embedding OBJ

Software: Away3D 4.x

Monguron, Newbie
Posted: 17 October 2011 11:31 AM   Total Posts: 27

Hello,

I started to use the following code from a sample file:

[Embed(source=”/../embeds/head/head.obj”, mimeType=“application/octet-stream”)]
private var OBJData : Class;

[Embed(source=”/../embeds/head/Images/Map-COL.jpg”)]
private var Albedo : Class;

[Embed(source=”/../embeds/head/Images/Map-spec.jpg”)]
private var Specular : Class;

[Embed(source=”/../embeds/head/Images/Infinite-Level_02_Tangent_NoSmoothUV.jpg”)]
private var Normal : Class;

But I only need to load two simple .dds, .tex, or .jpg pictures to attach them to the model ,obj.
I also have .mat files.

Any idea, how to modify the code?

Thanks in advance Richard smile

   

Richard Olsson, Administrator
Posted: 17 October 2011 07:24 PM   Total Posts: 1192   [ # 1 ]

I’m not sure I understand your question. Do you want to load an embedded OBJ file, and bind any dependency references in that file to embedded data as well? If so, then take a look at the AssetLoaderContext’s mapping methods, and the loadData() method on Loader3D, AssetLoader and AssetLibrary.

If you just want to use embedded bitmaps as textures for a model which may or may not already have a texture, use a BitmapMaterial along with the embedded bitmaps.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X