开发者

Cannot apply material to a *.obj in away3d

开发者 https://www.devze.com 2023-01-11 04:40 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消