I am currently working on developing a Cordova game using Three.js with the goal of making it playable offline. However, I have encountered an issue where Three.js requires texture files to be served via HTTP, making it challenging to achieve offline functionality. Is there a workaround for this limitation? I am trying to avoid setting up a Node.js server for my game, if possible.
Before dismissing the possibility, consider the existence of numerous 3D games on platforms like Google Play and the App Store that are fully functional offline, such as Temple Run and Match 3D. How do these games manage to work offline?
My attempts to load GLB/GLTF models have led me to use the "import {GLTF}" method in my index.js file. However, declaring index.js as a module in my index.html file triggers a CORS issue.
I have also experimented with converting my .glb files to .json and utilizing Three.js's built-in "ObjectLoader". Unfortunately, this approach resulted in an error message stating "THREE.ObjectLoader: Can't load resources/models/test.json".
index.html
<!--HTML code excluded for brevity-->
index.js
// JavaScript code excluded for brevity
config.xml
<!--XML code excluded for brevity-->
Plugin List
<!--Plugin list excluded for brevity-->
Folders & Files Structure (Omitted most irrelevant files)
<!--File structure excluded for brevity-->
Android Studio Logcat (Debug)
<!--Logcat details excluded for brevity-->