How to add events to imported Obj in three.js?

found that click events could not be added to the imported obj because obj is of type group.
so you need to convert obj to type mesh.
but I don"t know how to implement it. Do you have a great god to explain it

?
Mar.11,2021

The

scenario does not add object, but each of its child.

loader.load( 'model.obj', function ( object ) {
    object.traverse( function ( child ) {
        if ( child instanceof THREE.Mesh ) {
            scene.add( child );                
        }
    } );
} );

add child, and add materials to each child

loader.load( 'models.obj', function ( object ) {
    object.traverse( function ( child ) {
        if ( child instanceof THREE.Mesh ) {
            var phongMaterial = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0x111111, shininess: 5 } );
            child.material = phongMaterial;
        }
    } );
} );
Menu