function initControls(materials, setMaterial)
{
    document.querySelector("#wireframeCheckbox").addEventListener('change', () => toggleWireframe(materials) );

    document.querySelector('#diffuseColor').addEventListener('change', event=>{
        setMaterialDiffuse(materials, event.target.value);
    });
    document.querySelector('#diffuseColor').addEventListener('input', event=>{
        setMaterialDiffuse(materials, event.target.value);
    });
        
    document.querySelector('#specularColor').addEventListener('change', event=>{
        setMaterialSpecular(materials, event.target.value);
    });
    document.querySelector('#specularColor').addEventListener('input', event=>{
        setMaterialSpecular(materials, event.target.value);
    });
    
    document.querySelector("#textureCheckbox").addEventListener('change', () => toggleTexture(setMaterial) );

    document.querySelectorAll('input[name="materialRBGroup"').forEach(element =>{
        element.addEventListener('change', () => changeMaterial(setMaterial) );
    });
}
/**
 * Adds the event handlers to all the input groups
 * @param {Object} materials Object that contains all the materials used in the scene
 * @param {function} setMaterial The function that sets the material of the mesh based on a name from the web page
 */
Adds the event handlers to all the input groups
@param {Object} materials Object that contains all the materials used in the scene
@param {function} setMaterial The function that sets the material of the mesh based on a name from the web page
Adds the event handlers to all the input groups @param { Object } materials Object that contains all the materials used in the scene @param { function } setMaterial The function that sets the material of the mesh based on a name from the web page
function initControls(materials, setMaterial)
{
    document.querySelector("#wireframeCheckbox").addEventListener('change', () => toggleWireframe(materials) );
    document.querySelector('#diffuseColor').addEventListener('change', event=>{
        setMaterialDiffuse(materials, event.target.value);
    });
    document.querySelector('#diffuseColor').addEventListener('input', event=>{
        setMaterialDiffuse(materials, event.target.value);
    });
    document.querySelector('#specularColor').addEventListener('change', event=>{
        setMaterialSpecular(materials, event.target.value);
    });
    document.querySelector('#specularColor').addEventListener('input', event=>{
        setMaterialSpecular(materials, event.target.value);
    });
    document.querySelector("#textureCheckbox").addEventListener('change', () => toggleTexture(setMaterial) );
    document.querySelectorAll('input[name="materialRBGroup"').forEach(element =>{
        element.addEventListener('change', () => changeMaterial(setMaterial) );
    });
}
function initControls ( materials , setMaterial ) { document . querySelector ( "#wireframeCheckbox" ) . addEventListener ( 'change' , ( ) => toggleWireframe ( materials ) ) ; document . querySelector ( '#diffuseColor' ) . addEventListener ( 'change' , event => { setMaterialDiffuse ( materials , event . target . value ) ; } ) ; document . querySelector ( '#diffuseColor' ) . addEventListener ( 'input' , event => { setMaterialDiffuse ( materials , event . target . value ) ; } ) ; document . querySelector ( '#specularColor' ) . addEventListener ( 'change' , event => { setMaterialSpecular ( materials , event . target . value ) ; } ) ; document . querySelector ( '#specularColor' ) . addEventListener ( 'input' , event => { setMaterialSpecular ( materials , event . target . value ) ; } ) ; document . querySelector ( "#textureCheckbox" ) . addEventListener ( 'change' , ( ) => toggleTexture ( setMaterial ) ) ; document . querySelectorAll ( 'input[name="materialRBGroup"' ) . forEach ( element => { element . addEventListener ( 'change' , ( ) => changeMaterial ( setMaterial ) ) ; } ) ; }
Adds the event handlers to all the input groups
 @param {Object} materials Object that contains all the materials used in the scene
 @param {function} setMaterial The function that sets the material of the mesh based on a name from the web page
Adds the event handlers to all the input groups @param { Object } materials Object that contains all the materials used in the scene @param { function } setMaterial The function that sets the material of the mesh based on a name from the web page