Start a new topic

Load 3D models from server

Hello, 


I'm trying to load 3D models for this sample  https://github.com/Wikitude/wikitude-sdk-samples/tree/master/04_InstantTracking_3_GesturesAnd3DModels, that are stored locally on a node server and I expose them using express.static, but it's not working.


I just changed 

var model = new AR.Model(World.modelPaths[pathIndex], {...)

with

var model = new AR.Model("https://192.168.0.101:3003/files/clock.wt3", ....)


Can you please tell me what I'm doing wrong? Or if I can/not download models this way


UPDATE:


I've managed to pass to world.js the nativeURLs from cordova plugin after the world is loaded and it looks like this

file:///var/mobile/Containers/Data/Application/4393C59F-87D0-44E6-AD6A-060EFCE1E152/Library/NoCloud/clock.wt3 and I'm updating the World.modelPaths variable, but after I select one model isn't appearing in the scene. Can you please help me with some info about URL or how I can implement a dinamically 3D models storage :/

Good morning,



you should definitely be able to load a model from a remote location. As I have no knowledge about express.static I cannot provide any guidance in that regard.


What I'd like you to do is implement the onError callback of the AR.Model and report back to me with the error message you are receiving.


var myModel = new AR.Model("your_remote_link", {
    onError: function(message) { alert(message); }
});

 

Maybe you could try using the default HTTPS port (443) instead of 3003 and see whether that changes anything.



- Daniel


Login or Signup to post a comment