Loading 3d model fails

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.

My first three.js app
<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>

Can you please share the OBJ file in this thread?

Hi!
Why did you comment the function with animation loop?

This was an example of a script. I played around, also with commenting, to get rid of errors. I just wanted to see once the model on the scene.

HW

-----Original-Nachricht-----

The far plane of the frustum should be further than 10, set it, for example, to 1000.

Hi again,

just a background info: the model is a scan of an existing church in our village ( 1.7 MB), originally given to me as a .gbl file. I converted it in different model files: obj, stl, gltf . The animation of a 3d model should be included in a fund raising campaign for keeping and restoring this old church…

This was an example of a script. I played around, also with commenting, to get rid of errors. I just wanted to see once the model on the scene.

HW

-----Original-Nachricht-----

Check the fiddle, the model is Okay :slight_smile: