我正在基于Cordova的应用程序中测试Wikitude sample。我可以在我的Android Moto g4 +设备上运行它,但是我不确定“01_ImageRecognition_1_ImageOnTarget”样本到底是做什么的。
在我的案例中,应用程序已启动,我已添加了一个按钮,我点击了其中,我初始化了wikitude,这里是源代码:
// Url/Path to the augmented reality experience you would like to load
self.arExperienceUrl = "www/wikitudesample/01_ImageRecognition_1_ImageOnTarget/index.html";
// The features your augmented reality experience requires, only define the ones you really need
self.requiredFeatures = ["image_tracking"];
// Represents the device capability of launching augmented reality experiences with specific features
self.isDeviceSupported = false;
// Additional startup settings, for now the only setting available is camera_position (back|front)
self.startupConfiguration = {
"camera_position": "back",
"camera_resolution": "auto"
};
// Application Constructor
self.initialiseWikitude = function () {
console.log("wikitude: initialize");
self.wikitudePlugin = cordova.require("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin");
console.log("after require");
self.wikitudePlugin.isDeviceSupported(self.onDeviceSupported, self.onDeviceNotSupported, self.requiredFeatures);
};
// Callback if the device supports all required features
self.onDeviceSupported = function () {
console.log("wikitude: onDeviceSupported");
self.wikitudePlugin.loadARchitectWorld(
self.onARExperienceLoadedSuccessful,
self.onARExperienceLoadError,
self.arExperienceUrl,
self.requiredFeatures,
self.startupConfiguration
);
};
// Callback if the device does not support all required features
self.onDeviceNotSupported = function (errorMessage) {
alert(errorMessage);
console.log("wikitude: onDeviceNotSupported");
};
// Callback if your AR experience loaded successful
self.onARExperienceLoadedSuccessful = function (loadedURL) {
/* Respond to successful augmented reality experience loading if you need to */
console.log("wikitude: onARExperienceLoadedSuccessful");
};
在启动app时,我点击按钮调用上面的代码。单击按钮一切都成功(基于控制台日志)。不过这个样本到底在做什么?
如果可能,有人可以发布此样本的视频录制吗?