title: Loading a 3d model from DB and using it in Three.js
body: <p>now my task is to load a 3d model from a MySQL database and use it in Three.js.</p>
  
  <p>Here is what I have done,</p>
  
  <p>i created a database like this</p>
  
  <pre><code>models{model_id int(4), model mediumblob};
  </code></pre>
  
  <p>I can successfully load the 3d models in JSON format to and from the database.</p>
  
  <p>I know how to retrive the data from DB.</p>
  
  <p>But my problem is - 'How do i make the JSON file that is loaded from DB to be used by Three.js?'</p>
  
  <p>I load the Json file conventionally like this</p>
  
  <pre><code>// instantiate a loader
  var loader = new THREE.JSONLoader();
  
      // load a resource
      loader.load(
      // resource URL
      'models/animated/monster/monster.js',
      // Function when resource is loaded
      function ( geometry, materials ) {
          var material = new THREE.MultiMaterial( materials );
          var object = new THREE.Mesh( geometry, material );
          scene.add( object );
      }
  );
  </code></pre>
  
  <p>This is an example code from Three.js documentation.</p>
  
  <p>The resource URL appears to be a file located physically in the root.
  But I can't figure it out in my head 'how to load the model obtained from Database to Three.js?'</p>
  
  <p>I am not asking for any code.</p>
  
  <p>Just guide me to load the file in Three.js</p>
  
  <p>I am familiar with loading an simple image. But that is html oriented. This is Three.js oriented. </p>