Ich kann nicht scheinen, THREEjs Objekte mit dem threejs npm Build und browserifizieren instanziieren.Konstruktor Probleme mit Threejs npm und Browserify
var THREE = require("three-js");
var camera = new THREE.PerspectiveCamera(75, 1, 20, 2250);
dies ein Fehler sehe ich kann
bundle.js:24 Uncaught TypeError: THREE.PerspectiveCamera is not a constructor
führt, dass der Konstruktor in bundle.js
existiertTHREE.PerspectiveCamera = function (fov, aspect, near, far) {
THREE.Camera.call(this);
this.type = 'PerspectiveCamera';
this.fov = fov !== undefined ? fov : 50;
this.zoom = 1;
this.near = near !== undefined ? near : 0.1;
this.far = far !== undefined ? far : 2000;
this.focus = 10;
this.aspect = aspect !== undefined ? aspect : 1;
this.view = null;
this.filmGauge = 35; // width of the film (default in millimeters)
this.filmOffset = 0; // horizontal film offset (same unit as gauge)
this.updateProjectionMatrix();
};
Wie ich aus einem Arbeits bauen diesen Code bin Portierung ich, dass ich vermute, kann mit Browserify etwas falsch machen.
npm Threejs bauen Version 79