Start a new topic

Wikitude Cordova

Wikitude Cordova


Dear Wikitude Community,

I am trying to develop an app from only one sample (Geo-located 3d model) using corvoda setup. I have installed "node-v4.2.6-x64" and "Git-2.7.0.2-64-bit" and build project as it was described here: http://www.wikitude.com/developer/documentation/phonegap 

I did all the steps of "CREATING AN EMPTY NEW APP". Then I did "USING THE WIKITUDE PLUGIN TO CREATE YOUR OWN AUGMENTED REALITY EXPERIENCE". My experience contains "Geo-located 3d model" sample only. I put experience folder inside the "www" folder. I attached www folder to this letter.

Here is the how my "index.js" look like:

var app = {
// Url/Path to the augmented reality experience you would like to load
arExperienceUrl: "www/experience/index.html",
// The features your augmented reality experience requires, only define the ones you really need
requiredFeatures: ,
// Represents the device capability of launching augmented reality experiences with specific features
isDeviceSupported: false,
// Additional startup settings, for now the only setting available is camera_position (back|front)
startupConfiguration:
{
"camera_position": "back"
},

// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
app.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
app.wikitudePlugin.isDeviceSupported(app.onDeviceSupported, app.onDeviceNotSupported, app.requiredFeatures);
},
// Callback if the device supports all required features
onDeviceSupported: function() {
app.wikitudePlugin.loadARchitectWorld(
app.onARExperienceLoadedSuccessful,
app.onARExperienceLoadError,
app.arExperienceUrl,
app.requiredFeatures,
app.startupConfiguration
);
},
// Callback if the device does not support all required features
onDeviceNotSupported: function(errorMessage) {
alert(errorMessage);
},
// Callback if your AR experience loaded successful
onARExperienceLoadedSuccessful: function(loadedURL) {
alert('Augmented reality experience is loading successfully');
},
// Callback if your AR experience did not load successful
onARExperienceLoadError: function(errorMessage) {
alert('Loading AR web view failed: ' + errorMessage);
}
// Update DOM on a Received Event
receivedEvent: function(id) {
var parentElement = document.getElementById(id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');

listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');

console.log('Received Event: ' + id);
}
};

app.initialize();

 

However, my world is not loading at al.

Please help me. What shall I do?

Thank you in advance!

 

Hi Yelbek,
My first guess is, that your call to loadARchitectWorld is wrong. Can you please have a look at our current Cordova example application and in particular at this line? 

Best regards

Andreas

Ok thank you. I have also tried to do "ADD SAMPLES MANUALLY TO YOUR APP", and it worked. I will try to customize it. 

Thank you again.

Best regards,

Yelbek 

Have fun using our AR SDK!
Login or Signup to post a comment