Edit Code
Learn how to edit code and parse data in your React Native project.
...
/* Parse echo3D database */
// Iterage over all database entries
var entries = []
for (let entry of Object.values(global.echoDB.db)) {
// Parse entry
var srcFile = "https://api.echo3D.com/query?key=" + apiKey + "&file=";
var typeFile = entry['hologram'].filename.toLowerCase().split('.').pop();
switch (entry['hologram'].type) {
case 'VIDEO_HOLOGRAM':
case 'IMAGE_HOLOGRAM':
srcFile += entry['hologram'].storageID;
break;
case 'MODEL_HOLOGRAM':
switch (typeFile) {
case 'glb':
srcFile += entry['hologram'].storageID;
break;
case 'gltf':
case 'obj':
case 'fbx':
srcFile += entry['additionalData'].glbHologramStorageID;
break;
}
break;
}
// Parse additional data
var x = (entry['additionalData'].x) ?
parseFloat(entry['additionalData'].x) : 0;
// Do something with the entry
...
}
...Last updated