sagir
1
İ want to use this example.
https://threejs.org/examples/?q=light#webgl_materials_lightmap
İ add loader code
var loader = new GLTFLoader().setPath( ‘models/gltf/DamagedHelmet/glTF/’ );
loader.load( ‘DamagedHelmet.gltf’, function ( gltf ) {
scene.add( gltf.scene );
});
İt done
Uncaught TypeError: THREE.GLTFLoader is not a constructor
You must first import GLTFLoader
from a separate file (it’s not a part of core ThreeJS.)
See this example:
Edit: The error suggests your code looks a bit different, too. It should be new GLTFLoader()
, without the THREE.
part.
2 Likes
sagir
3
İ try your solution but ,.
My problem continue
sagir
4
Ah okey now solved problem. Thanks