Hi there,
I am a beginner, using mostly paste and copy.
I am trying to load an .obj model on a scene, but I am getting only a dark screen without the model. No errors in the console or debugger.
Could I get some hints what is wrong with the html or script.
<style>
body {
margin: 0;
}
canvas {
width: 400px;
height: 400px;
}
</style>
<script>
var renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 10 );
var scene = new THREE.Scene();
var light = new THREE.AmbientLight(0xffffff, 0.5);
scene.add(light);
var kirche3d = new THREE.ObjectLoader('Kirche3D.obj');
var loader = new THREE.OBJLoader();
loader.load('kirche3d.obj', handle_load);
function handle_load(geometry, materials) {
var material = new THREE.MeshNormalMaterial;
var mesh = new three.mesh(geometry, materials);
scene.add(mesh);
mesh.position.z = -10;
}
/*var material = new THREE.MeshNormalMaterial;
var kirche = loader.load('Kirche3D.obj');
var kirche3d = new THREE.Object3D(kirche, material);
kirche3d.scale.set(1, 1, 1);
scene.add(kirche3d);**/
var objLoader = new THREE.OBJLoader();
objLoader.setPath('AlteKircheIgel.org/assets/videos/');
objLoader.load('Kirche3D.obj', function(object) {
object.position.y -= 60;
scene.add(object);
})
camera.position.z = 150;
/*var animate = function () {
requestAnimationFrame(animate);
Object.rotation.x += 0.01;
Object.rotation.y += 0.01;
Object.rotation.z += 0.00;
renderer.render( scene, camera );
};
animate();**/
</script>