I want to load some models in my application and I’ve followed some examples, try some of them but I haven’t got any success. This is the script I’m trying right now, I know this isn’t the right way to load multiple assets in the future but it’s only a test to see if I can have success loading an asset from an url.
TestS3.prototype.initialize = function()
{
// allow cross origin texture requests
this.app.loader.getHandler("texture").crossOrigin = "anonymous";
this.app.loader.getHandler("model").crossOrigin = "anonymous";
this.loadPlayer();
this.url = "https://s3-us-west-2.amazonaws.com/s.cdpn.io/2666677/";
};
TestS3.prototype.loadPlayer = function()
{
var entity = this.entity;
entity.addComponent("model");
this.app.assets.loadFromUrl(this.url + "FireFighter.fbx", "model", function (err, asset)
{
entity.model.model = asset.resource;
pc.app.root.addChild(entity);
entity.setLocalPosition(0, 0, 0);
});
};
This is the error I got:
I followed this example:
https://playcanvas.com/editor/code/501253?tabs=8936727