title: Three.js error "camera is not an instance of THREE.Camera" when trying to render a cube
body: <p>I'm trying to make a little "engine" of sorts that allows me to easily create and position objects using three.js. So far I am able to set up a scene, renderer, and camera and everything seems to be working properly, until I try to render and attach a cube to my scene.</p>
  
  <p>I am able to create the cube and attach it to my scene just fine, but my code seems to fail when I try to use the render() function in three.js and I get the error:</p>
  
  <pre><code>THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.
  </code></pre>
  
  <p>But I'm not really sure why. I can't find much about this error online so I was hoping someone here could point me in the right direction.</p>
  
  <p>While troubleshooting, I tried to output my cube to the console to see if I could get any useful info from it. It seems like it attaches to my scene just fine and both my scene and camera show up as a parent object to the cube.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>function spnScene(alias, fov, x, y, z) {
      window.spnCreateScene = new THREE.Scene();
      var WIDTH = window.innerWidth, HEIGHT = window.innerHeight;
  
      if (alias == false) {
          console.warn('spnRenderer scene antialias set to ' + alias + ". Please check your code to make sure it's correct.");
      }
  
      spnRenderer = new THREE.WebGLRenderer({
          antialias: alias
      });
      spnRenderer.setSize(WIDTH, HEIGHT);
      document.body.appendChild(spnRenderer.domElement);
  
      // create camera
  
      spnCamera = new THREE.PerspectiveCamera(fov, WIDTH / HEIGHT, 2000);
      spnCamera.position.set(x, y, z);
      spnCreateScene.add(spnCamera);
  }
  
  function spnBasicCube(material, clr, l, w, depth, x, y, z) { // draw a basic cube and render it
      if (material == "basic") {
          var spnBasicCube = new THREE.Mesh(new THREE.CubeGeometry(l, w, depth), new THREE.MeshBasicMaterial({color: clr}));
          spnBasicCube.position.x = x;
          spnBasicCube.position.y = y;
          spnBasicCube.position.z = z;
          spnCreateScene.add(spnBasicCube);
  
          spnRenderer.render(spnBasicCube);
  
          console.log(spnBasicCube);
  
          // this should end up making a cube but throws an error rn
      }
  }
  </code></pre>
  
  <p>I hope someone can help me out! Thanks! :)</p>