How to add glb loader in lightmap example

İ 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

İ try your solution but ,.
My problem continue :frowning:

Ah okey now solved problem. Thanks