Cannot apply material to a *.obj in away3d
I cannot apply a texture to an object, I don't know why...
( AS3 blender export script and Collada Import is not working for me either )
Any idea?
var loader:Loader3D = new Loader3D();
loader.addEventListener( Loader3DEvent.LOAD_SUCCESS,
handler_loadSuccess );
var parser:Obj = new Obj();
loader.loadGeometry( "assets/objects/Test.obj", parser );
private function handler_loadSuccess( event:Loader3DEvent ):void
{
trace( "Success" );
mat = new ColorMaterial( 0xFFFFFF );
开发者_StackOverflow中文版 var mesh:Mesh = event.loader.handle as Mesh;
mesh.material = mat;
mesh.scale( 40 )
mesh.x = 300;
viewport.scene.addChild( mesh );
}
Ok,
I solved this by applying the material to all subfaces.
精彩评论