Skip to content

Instantly share code, notes, and snippets.

@madclaws

madclaws/loader.ts

Created Nov 16, 2018
Embed
What would you like to do?
obj model loading issue
private loadAssets(){
console.log("loading assets");
this._assetManager=new AssetsManager(this._Scene);
let meshTask=this._assetManager.addMeshTask("gemTask","gem","../Assets/","diamond.obj");
meshTask.onSuccess=(task:MeshAssetTask)=>{
console.log("load success");
task.loadedMeshes[0].position=Vector3.Zero();
}
meshTask.onError=(task,message,exception)=>{
console.log(message,exception);
}
this._assetManager.onFinish=(tasks)=>{
console.log("loading finished");
this.runEngine();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment