Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- storing a three.js mesh object with indexedDB
- object = new THREE.Mesh( geometry, material );
- webkitIndexedDB.open("MyNewDB").onsuccess = function(event) {
- window.db = event.srcElement.result;
- window.db.setVersion("1.0").onsuccess = function(event) {
- var objectStore = window.db.createObjectStore("meshes", { keyPath: "item_id" });
- objectStore.add({item_id: 0, mesh: object}); // <= this is the crucial line
- };
- };
Add Comment
Please, Sign In to add comment