spherecylinder.js
// Fonction permettant la construction du Cockpit et de l'antenne au dessus
Fonction permettant la construction du Cockpit et de l'antenne au dessus
Fonction permettant la construction du Cockpit et de l ' antenne au dessus
function cockpit() {
    changePhong();
    setColor(1,0.1,0.1,1,0.1,0.1,1,0.1,0.1);
    callTexture(glass, gl.TEXTURE2, 2);
    modelview = initialmodelview;
    modelview = mult(modelview, translate(-6, 4, 0));
    modelview = mult(modelview, rotate(270, 0, 1, 0));
    normalMatrix = extractNormalMatrix(modelview);  
    modelview = mult(modelview, scale(0.5, 0.3, 1.2));
    triangle.render();
    modelview = initialmodelview;
    modelview = mult(modelview, translate(3, 4, 0));
    modelview = mult(modelview, rotate(90, 0, 1, 0));
    modelview = mult(modelview, rotate(0, 1, 0, 0));
    normalMatrix = extractNormalMatrix(modelview);  
    modelview = mult(modelview, scale(0.5, 0.3, 0.6));
    triangle.render();
    resetColor();
    changePhong();
    resetTexture();
    modelview = initialmodelview;
    modelview = mult(modelview, translate(7, 3, 0));
    modelview = mult(modelview, rotate(90, 0, 1, 0));
    normalMatrix = extractNormalMatrix(modelview);  
    modelview = mult(modelview, scale(0.501, 0.3, 1.1));
    cube1.render();
    callTexture(blackTexture2, gl.TEXTURE3, 3);
    modelview = initialmodelview;
    modelview = mult(modelview, translate(7, 5, 0));
    modelview = mult(modelview, rotate(90, 0, 1, 0));
    normalMatrix = extractNormalMatrix(modelview);  
    modelview = mult(modelview, scale(0.1, 0.2, 0.6));
    cube1.render();
    resetTexture();
    modelview = initialmodelview;
    modelview = mult(modelview, translate(7, 6, 0));
    modelview = mult(modelview, rotate(90, 0, 1, 0));
    normalMatrix = extractNormalMatrix(modelview);  
    modelview = mult(modelview, scale(0.5, 0.5, 0.8));
    cylindre.render();
    modelview = initialmodelview;
    modelview = mult(modelview, translate(0, 6, 0));
    modelview = mult(modelview, rotate(90, 0, 1, 0));
    normalMatrix = extractNormalMatrix(modelview);  
    modelview = mult(modelview, scale(0.3, 0.3, 0.7));
    cylindre.render();
    modelview = initialmodelview;
    modelview = mult(modelview, translate(-7, 6, 0));
    modelview = mult(modelview, rotate(90, 0, 1, 0));
    normalMatrix = extractNormalMatrix(modelview);  
    modelview = mult(modelview, scale(0.2, 0.2, 0.7));
    cylindre.render();
}
function cockpit ( ) { changePhong ( ) ; setColor ( 1 , 0.1 , 0.1 , 1 , 0.1 , 0.1 , 1 , 0.1 , 0.1 ) ; callTexture ( glass , gl . TEXTURE2 , 2 ) ; modelview = initialmodelview ; modelview = mult ( modelview , translate ( - 6 , 4 , 0 ) ) ; modelview = mult ( modelview , rotate ( 270 , 0 , 1 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 0.5 , 0.3 , 1.2 ) ) ; triangle . render ( ) ; modelview = initialmodelview ; modelview = mult ( modelview , translate ( 3 , 4 , 0 ) ) ; modelview = mult ( modelview , rotate ( 90 , 0 , 1 , 0 ) ) ; modelview = mult ( modelview , rotate ( 0 , 1 , 0 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 0.5 , 0.3 , 0.6 ) ) ; triangle . render ( ) ; resetColor ( ) ; changePhong ( ) ; resetTexture ( ) ; modelview = initialmodelview ; modelview = mult ( modelview , translate ( 7 , 3 , 0 ) ) ; modelview = mult ( modelview , rotate ( 90 , 0 , 1 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 0.501 , 0.3 , 1.1 ) ) ; cube1 . render ( ) ; callTexture ( blackTexture2 , gl . TEXTURE3 , 3 ) ; modelview = initialmodelview ; modelview = mult ( modelview , translate ( 7 , 5 , 0 ) ) ; modelview = mult ( modelview , rotate ( 90 , 0 , 1 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 0.1 , 0.2 , 0.6 ) ) ; cube1 . render ( ) ; resetTexture ( ) ; modelview = initialmodelview ; modelview = mult ( modelview , translate ( 7 , 6 , 0 ) ) ; modelview = mult ( modelview , rotate ( 90 , 0 , 1 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 0.5 , 0.5 , 0.8 ) ) ; cylindre . render ( ) ; modelview = initialmodelview ; modelview = mult ( modelview , translate ( 0 , 6 , 0 ) ) ; modelview = mult ( modelview , rotate ( 90 , 0 , 1 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 0.3 , 0.3 , 0.7 ) ) ; cylindre . render ( ) ; modelview = initialmodelview ; modelview = mult ( modelview , translate ( - 7 , 6 , 0 ) ) ; modelview = mult ( modelview , rotate ( 90 , 0 , 1 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 0.2 , 0.2 , 0.7 ) ) ; cylindre . render ( ) ; }
Fonction permettant la construction du Cockpit et de l'antenne au dessus
Fonction permettant la construction du Cockpit et de l ' antenne au dessus
// always extract the normal matrix before scaling // always extract the normal matrix before scaling // always extract the normal matrix before scaling // always extract the normal matrix before scaling // always extract the normal matrix before scaling // always extract the normal matrix before scaling // always extract the normal matrix before scaling //resetColor(); //resetTexture();