spherecylinder.js
// Fonction permettant la construction de la Carlingue et de son moteur arriere
Fonction permettant la construction de la Carlingue et de son moteur arriere
Fonction permettant la construction de la Carlingue et de son moteur arriere
function carlingue() {
    resetColor();
    resetTexture();
    modelview = initialmodelview;
    modelview = mult(modelview, rotate(270, 1, 0, 0));
    normalMatrix = extractNormalMatrix(modelview);  
    modelview = mult(modelview, scale(2.5, 0.5, 0.5));
    cube1.render();
    modelview = initialmodelview;
    modelview = mult(modelview, translate(13, 0, 0));
    modelview = mult(modelview, rotate(90, 0, 1, 0));
    normalMatrix = extractNormalMatrix(modelview);  
    modelview = mult(modelview, scale(2, 2, 0.3));
    cylindreNoBottom.render();
    changePhong(); 
    setColor(0.1,0.1,0.1,0,0,0,0,0,0);
    callTexture(blackTexture, gl.TEXTURE1, 1);
    for (var i = 0; i < 15; i++) {
        modelview = initialmodelview;
        modelview = mult(modelview, translate(14.0, 0, 0.0));
        modelview = mult(modelview, rotate(i*15, 1, 0, 0));
        normalMatrix = extractNormalMatrix(modelview);  
        modelview = mult(modelview, scale(0.1, 0.39, 0.02));
        cube1.render();
    }
    resetColor();
    changePhong(); 
    resetTexture();
    modelview = initialmodelview;
    modelview = mult(modelview, translate(13.5, 3.3, 0));
    modelview = mult(modelview, rotate(90, 0, 1, 0));
    normalMatrix = extractNormalMatrix(modelview);  
    modelview = mult(modelview, scale(0.5, 0.25, 0.2));
    triangle.render();
}
function carlingue ( ) { resetColor ( ) ; resetTexture ( ) ; modelview = initialmodelview ; modelview = mult ( modelview , rotate ( 270 , 1 , 0 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 2.5 , 0.5 , 0.5 ) ) ; cube1 . render ( ) ; modelview = initialmodelview ; modelview = mult ( modelview , translate ( 13 , 0 , 0 ) ) ; modelview = mult ( modelview , rotate ( 90 , 0 , 1 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 2 , 2 , 0.3 ) ) ; cylindreNoBottom . render ( ) ; changePhong ( ) ; setColor ( 0.1 , 0.1 , 0.1 , 0 , 0 , 0 , 0 , 0 , 0 ) ; callTexture ( blackTexture , gl . TEXTURE1 , 1 ) ; for ( var i = 0 ; i < 15 ; i ++ ) { modelview = initialmodelview ; modelview = mult ( modelview , translate ( 14.0 , 0 , 0.0 ) ) ; modelview = mult ( modelview , rotate ( i * 15 , 1 , 0 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 0.1 , 0.39 , 0.02 ) ) ; cube1 . render ( ) ; } resetColor ( ) ; changePhong ( ) ; resetTexture ( ) ; modelview = initialmodelview ; modelview = mult ( modelview , translate ( 13.5 , 3.3 , 0 ) ) ; modelview = mult ( modelview , rotate ( 90 , 0 , 1 , 0 ) ) ; normalMatrix = extractNormalMatrix ( modelview ) ; modelview = mult ( modelview , scale ( 0.5 , 0.25 , 0.2 ) ) ; triangle . render ( ) ; }
Fonction permettant la construction de la Carlingue et de son moteur arriere
Fonction permettant la construction de la Carlingue et de son moteur arriere
//modelview = mult(modelview, translate(0.0, 0.0, 0.0)); // always extract the normal matrix before scaling // always extract the normal matrix before scaling // Desactive phong // always extract the normal matrix before scaling // Reactive phong // always extract the normal matrix before scaling