I have written an animation and rendered it on a mobile app using React Native Expo and Three.js.
Now I want to export that animation in GLTF format and save it on mobile (not a web application) or any format that I can open later on mobile as 3d image, However I am getting an error.
Thanks for your reply.
Important point to note here is , I am using this on my mobile app and 3d functionality is displayed perfectly on app using this code.
However I want to download/export that 3d scene on my mobile for which I need help.
<GLView
onContextCreate={gl => {
const scene = new THREE.Scene();
scene.name=‘photo’;
const camera = new THREE.PerspectiveCamera(
75, gl.drawingBufferWidth / gl.drawingBufferHeight, 0.1, 1000
);
const renderer = new Renderer({ gl });
renderer.setSize(gl.drawingBufferWidth, gl.drawingBufferHeight);
const geometry = new THREE.SphereBufferGeometry(1, 36, 36);
var image = “img.jpeg”; //Pulling image from some other source
var expoAsset = new Expo.Asset({ uri: image });
expoAsset.downloaded = true;
expoAsset.localUri = expoAsset.uri;
var texture = new TextureLoader().load(expoAsset);
const material = new THREE.MeshBasicMaterial({
map: texture