2 Replies Latest reply: Sep 30, 2014 1:56 AM by Thorsten Schröder RSS

    Trouble with integration of external javascript library

    Thorsten Schröder

      Hello community,

       

      I'm new to the world of extensions and as a first test (after I've gone through the tutorials) I'm trying to integrate an external .js library but it says the object is not defined. In detail: The library is called three.js - which outputs 3d elements.

       

      Here's what my first test should display:

      http://jsfiddle.net/Q7DLQ/

       

      Little excerpt:

      function ThreeJS() {

          var camera, scene, renderer;

          var geometry, material, mesh;

          init();

          animate();

          function init() {

              camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 10000); // Error: Three is not defined.

              camera.position.z = 1000;

      .......

      ......

      }

       

      Please note the attached zip-file.

       

      What have I done wrong?

       

      Thank you.