Hi Coffius!
I've had the same problem.
The model is without texture (white) because you apply the texture before 
the model is completely loaded by the* ResourceManager *(it loads the 
model asynchronously).
I've solved this problem by checking the *subMeshes.length* property of the 
*Mesh* object that contains the loaded 3d model data.

// in class body
[Embed(source="/../embeds/ogrobase.jpg")]
private var MyTexture : Class;

private var mesh:Mesh;

// load 3D object
resourceManager = ResourceManager.instance;
mesh = Mesh(resourceManager.getResource("assets/ogre.md2")); 

(...)

// for debugging purposes you can put the code below in onRenderFrame or 
similar method
// proper implementation would require separate event handling
if(mesh.subMeshes.length > 0) {
    mesh.material = new BitmapMaterial(new MyTexture().bitmapData);
}

BR,
dbow

http://www.doublebow.net

Reply via email to