Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Aug 14th, 2018 57 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. storing a three.js mesh object with indexedDB
  2. object = new THREE.Mesh( geometry, material );
  3.  
  4. webkitIndexedDB.open("MyNewDB").onsuccess = function(event) {
  5.   window.db = event.srcElement.result;
  6.  
  7.   window.db.setVersion("1.0").onsuccess = function(event) {
  8.     var objectStore = window.db.createObjectStore("meshes", { keyPath: "item_id" });
  9.  
  10.     objectStore.add({item_id: 0, mesh: object});  //  <= this is the crucial line
  11.  
  12.   };
  13. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top