Loading OBJ Model but Texture / Material not loading

Software: Away3D 4.x

Tom.de, Newbie
Posted: 04 April 2012 02:27 PM   Total Posts: 30

Hey everyone.

I just started working with away3D a few days ago, so this might be a very simple question.

I am currently trying to load a model via the Loader3D functionality.
The model loads fine, however, the texture / material does not.
This is how I load the model.

Parsers.enableAllBundled();
m_Loader3D = new Loader3D();
m_Loader3D.addEventListener(LoaderEvent.RESOURCE_COMPLETEonResourceComplete);
m_Loader3D.addEventListener(LoaderEvent.LOAD_ERRORonLoadError);
m_Loader3D.load( new URLRequest('../../GameApp/assets/models/icecube/ice_cube.obj') ); 

Gathering from the examples this should automatically load the texture as well? I have to manually apply a ColorMaterial in order to see the model.

I tried loading a texture and apply it to the mesh, unfortunately to no avail.

[Embed(source="/../../JeligniteApp/assets/models/icecube/ice04.png")]
private var Ice04:Class; 

and in onResourceComplete (the following approach works if I apply a ColorMaterial, not when using a BitmapMaterial)

var IceCubeBitmap Bitmap = new Ice04();
var 
IceCubeMaterial BitmapMaterial = new BitmapMaterialIceCubeBitmap.bitmapData );
var 
nc Number m_Loader3D.numChildren;
for (var 
Number 0nci++)
{
 
var Mesh Mesh Mesh(m_Loader3D.getChildAt(i));
 
Mesh.material IceCubeMaterial;

What could I be doing wrong?
Thanks in advance for your support!
(I have attached the file in question, just in case)

 

File Attachments
icecube.zip  (File Size: 570KB - Downloads: 163)
   

Limouse-Lee, Newbie
Posted: 06 April 2012 02:09 AM   Total Posts: 10   [ # 1 ]

worked with 3dsmax ??

your model have a wrong UV position…

 

   

Tom.de, Newbie
Posted: 06 April 2012 04:36 PM   Total Posts: 30   [ # 2 ]

Cheers, I will have a look at that.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X