https://www.dropbox.com/s/h59v7elqn05t7lc/bag.js
der folgende Code enthält den Link zur JSON-Datei
SyntaxError: JSON.parse: Erwarteter Namen für das Eigenschaftsname der doppelten Anführungszeichen
Javascript:
var init = function () {
var canv = document.getElementsByTagName("canvas")[0];
var w = canv.clientWidth;
var h = canv.clientHeight;
var renderer = new THREE.WebGLRenderer({
canvas: canv
});
renderer.setSize(w, h);
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(
15, // Sichtfeld
w / h, // Seitenverhältnis
0,1, // Nahe
10000 // Ferne
);
camera.position.set(-1, 1, 15);
scene.add(camera);
var light = new THREE.PointLight(0xFFFFDD);
light.position.set(-15, 10, 15);
scene.add(light);
var ambient = new THREE.AmbientLight(0x999999);
scene.add(ambient);
var loader = new THREE.JSONLoader();
var onGeometry = function (geom) {
var mesh = new THREE.Mesh(geom, new THREE.MeshFaceMaterial());
scene.add(mesh);
};
loader.load("vwbug.js", onGeometry);
var render = function () {
renderer.render(scene, camera);
};
setInterval(render, 10);
};
window.onload = init;
window.onresize = init;