我正在基于 Cordova 的应用程序中测试Wikiitude 示例。我可以在我的 android Moto g4+ 设备上运行它,但是我不确定“01_ImageRecognition_1_ImageOnTarget”示例到底在做什么。
在我的情况下,应用程序已启动,我添加了一个单击按钮,我初始化了维基,这里是源代码:
// 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");
};
在启动应用程序时,我在单击按钮时调用上述代码。单击按钮后,一切正常(基于控制台日志)。然而,这个样本到底在做什么?
如果可能的话,有人可以发布这个样本的视频记录吗?