IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

OpenGL Discussion :

OpenGl erreurs lors de la compilation


Sujet :

OpenGL

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    10
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2010
    Messages : 10
    Points : 9
    Points
    9
    Par défaut OpenGl erreurs lors de la compilation
    Salut tout le monde, je voudrais installer openGL sur mon ordi portable sur Ubuntu afin de pouvoir faire mes travaux pratiques de mon cours d'infographie sur mon portable et le cours utilise openGL, mais je suis bloqué lorsque je dois faire la commande make du makefile, ça me donne des erreurs pour tous les méthodes de glm.

    Voici le fichier makefile
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
     
    CONTEXT=sdl2
    ifeq "$(shell uname)" "Darwin"
        CONTEXT=glfw3
        LDFLAGS += -lobjc -framework Foundation -framework OpenGL -framework Cocoa
    endif
     
    CXXFLAGS += -g -W -Wall -Wno-unused-parameter -Wno-deprecated-declarations
    CXXFLAGS += $(shell pkg-config --cflags glew)
    CXXFLAGS += $(shell pkg-config --cflags $(CONTEXT))
     
    LDFLAGS += -g
    LDFLAGS += $(shell pkg-config --libs glew)
    LDFLAGS += $(shell pkg-config --libs $(CONTEXT))
     
    TP="tp2"
    SRC=main
     
    exe : $(SRC).exe
    run : exe
    	./$(SRC).exe
    $(SRC).exe : $(SRC).cpp *.h
    	$(CXX) $(CXXFLAGS) -o$@ $(SRC).cpp $(LDFLAGS)
     
    sol :  ; make SRC=$(SRC)Solution exe
    runs : ; make SRC=$(SRC)Solution run
     
    clean :
    	rm -rf *.o *.exe *.exe.dSYM
     
    remise zip :
    	make clean
    	rm -f INF2705_remise_$(TP).zip
    	zip -r INF2705_remise_$(TP).zip *.cpp *.h *.glsl makefile *.txt
    Voici le fichier main.cpp
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
     
     
    #include <stdlib.h>
    #include <iostream>
    #include "inf2705-matrice.h"
    #include "inf2705-nuanceur.h"
    #include "inf2705-fenetre.h"
    #include "inf2705-forme.h"
    #include <glm/gtx/io.hpp>
    #include <vector>
     
    #define SOMMETS 0
    #define CONNECTI 1
     
    // variables pour l'utilisation des nuanceurs
    GLuint prog;      // votre programme de nuanceurs
    GLint locVertex = -1;
    GLint locColor = -1;
    GLint locmatrModel = -1;
    GLint locmatrVisu = -1;
    GLint locmatrProj = -1;
    GLint locplanCoupe = -1;
    GLint loccoulProfondeur = -1;
    GLuint progBase;  // le programme de nuanceurs de base
    GLint locVertexBase = -1;
    GLint locColorBase = -1;
    GLint locmatrModelBase = -1;
    GLint locmatrVisuBase = -1;
    GLint locmatrProjBase = -1;
     
    // matrices du pipeline graphique
    MatricePipeline matrProj, matrVisu, matrModel;
     
    // les formes
    FormeCube *cube = NULL;
    FormeSphere *sphere = NULL;
    FormeTheiere *theiere = NULL;
    FormeTore *toreTerre = NULL;
    FormeTore *toreMars = NULL;
    FormeTore *toreJupiter = NULL;
    GLuint vao = 0;
    GLuint vbo[2] = {0,0};
     
    //
    // variables d'état
    //
    struct Etat
    {
       int modele;           // le modèle à afficher comme CorpsCeleste (1-sphère, 2-cube, 3-théière).
       bool modeSelection;   // on est en mode sélection?
       bool enmouvement;     // le modèle est en mouvement/rotation automatique ou non
       bool afficheAxes;     // indique si on affiche les axes
       bool coulProfondeur;  // indique si on veut colorer selon la profondeur
       GLenum modePolygone;  // comment afficher les polygones
       glm::ivec2 sourisPosPrec;
       // partie 1: utiliser un plan de coupe
       glm::vec4 planCoupe;  // équation du plan de coupe (partie 1)
       GLfloat angleCoupe;   // angle (degrés) autour de x (partie 1)
       // apprentissage supplémentaire: facteur de réchauffement
       float facteurRechauffement; // un facteur qui sert à calculer la couleur des pôles (0.0=froid, 1.0=chaud)
    } etat = { 1, false, true, true, false, GL_FILL, glm::ivec2(0), glm::vec4( 0, 0, 1, 0 ), 0.0, 0.2 };
     
    //
    // variables pour définir le point de vue
    //
    class Camera
    {
    public:
       void definir()
       {
          matrVisu.LookAt( dist*cos(glm::radians(theta))*sin(glm::radians(phi)),
                           dist*sin(glm::radians(theta))*sin(glm::radians(phi)),
                           dist*cos(glm::radians(phi)),
                           0, 0, 0,
                           0, 0, 1 );
     
          // (pour apprentissage supplémentaire): La caméra est sur la Terre et voir passer les autres objets célestes en utilisant l'inverse de la matrice mm
       }
       void verifierAngles() // vérifier que les angles ne débordent pas les valeurs permises
       {
          const GLdouble MINPHI = 0.01, MAXPHI = 180.0 - 0.01;
          phi = glm::clamp( phi, MINPHI, MAXPHI );
       }
       double theta;         // angle de rotation de la caméra (coord. sphériques)
       double phi;           // angle de rotation de la caméra (coord. sphériques)
       double dist;          // distance (coord. sphériques)
       bool modeLookAt;      // on utilise LookAt (au lieu de Rotate et Translate)
    } camera = { 90.0, 75.0, 35.0, true };
     
     
    //
    // les corps célestes
    //
    class CorpsCeleste
    {
    public:
       CorpsCeleste( float r, float dist, float rot, float rev, float vitRot, float vitRev,
                     glm::vec4 coul=glm::vec4(1.,1.,1.,1.), bool select = false, glm::vec4 coul2=glm::vec4(1.,1.,1.,1.)  ) :
          rayon(r), distance(dist),
          rotation(rot), revolution(rev),
          vitRotation(vitRot), vitRevolution(vitRev),
          couleur(coul),
          estSelectionne(select),
          couleurSel(coul2)
       { }
     
       void ajouteEnfant( CorpsCeleste &bebe )
       {
          enfants.push_back( &bebe );
       }
     
       void afficher( )
       {
          matrModel.PushMatrix(); {
             matrModel.Rotate( revolution, 0, 0, 1 ); // révolution du corps autour de son parent
             matrModel.Translate( distance, 0, 0 ); // position par rapport à son parent
     
             // afficher d'abord les enfants
             std::vector<CorpsCeleste*>::iterator it;
             for ( it  = enfants.begin() ; it!=enfants.end() ; it++ )
             {
                (*it)->afficher();
             }
     
             // afficher le parent
             matrModel.PushMatrix(); {
                matrModel.Rotate( rotation, 0, 0, 1 ); // rotation sur lui-même
                matrModel.Scale( rayon, rayon, rayon ); // la taille du corps
                glUniformMatrix4fv( locmatrModel, 1, GL_FALSE, matrModel );
     
                // la couleur du corps
                if (!etat.modeSelection)
                {
                    glVertexAttrib4fv( locColor, glm::value_ptr(couleur) );
                }
                else
                {
                    glVertexAttrib4fv( locColor, glm::value_ptr(couleurSel) );
                }
     
                switch ( etat.modele )
                {
                default:
                case 1:
                   sphere->afficher();
                   break;
                case 2:
                   cube->afficher();
                   break;
                case 3:
                   matrModel.Scale( 0.5, 0.5, 0.5 );
                   matrModel.Translate( 0.0, 0.0, -1.0 );
                   glUniformMatrix4fv( locmatrModel, 1, GL_FALSE, matrModel );
                   theiere->afficher( );
                   break;
                }
     
             } matrModel.PopMatrix(); glUniformMatrix4fv( locmatrModel, 1, GL_FALSE, matrModel );
     
          } matrModel.PopMatrix(); glUniformMatrix4fv( locmatrModel, 1, GL_FALSE, matrModel );
       }
     
       void avancerPhysique()
       {
           if (!estSelectionne)
           {
                const float dt = 0.5; // intervalle entre chaque affichage (en secondes)
                rotation += dt * vitRotation;     
                revolution += dt * vitRevolution;
           }
       }
     
       std::vector<CorpsCeleste*> enfants; // la liste des enfants
       float rayon;          // le rayon du corps
       float distance;       // la distance au parent
       float rotation;       // l'angle actuel de rotation en degrés
       float revolution;     // l'angle actuel de révolution en degrés
       float vitRotation;    // la vitesse de rotation
       float vitRevolution;  // la vitesse de révolution
       glm::vec4 couleur;    // la couleur du corps
       bool estSelectionne;  // le corps est sélectionné ?
       glm::vec4 couleurSel; // la couleur en mode sélection
    };
     
    //                     rayon  dist  rota revol vrota  vrevol
    CorpsCeleste Soleil(   4.00,  0.0,  0.0,  0.0, 0.05, 0.0,  glm::vec4(1.0, 1.0, 0.0, 0.5), false, glm::vec4(0.0, 0.0, 0.0, 0.0) );
     
    CorpsCeleste Terre(    0.70,  7.0, 30.0, 30.0, 2.5,  0.10, glm::vec4(0.5, 0.5, 1.0, 1.0), false, glm::vec4(0.0, 0.0, 0.0, 1.0) );
    CorpsCeleste Lune(     0.20,  1.5, 20.0, 30.0, 2.5, -0.35, glm::vec4(0.6, 0.6, 0.6, 1.0), false, glm::vec4(0.0, 0.0, 1.0, 0.0) );
     
    CorpsCeleste Mars(     0.50, 11.0, 20.0,140.0, 2.5,  0.13, glm::vec4(0.6, 1.0, 0.5, 1.0), false, glm::vec4(0.0, 0.0, 1.0, 1.0) );
    CorpsCeleste Phobos(   0.20,  1.0,  5.0, 15.0, 3.5,  1.7,  glm::vec4(0.4, 0.4, 0.8, 1.0), false, glm::vec4(0.0, 1.0, 0.0, 0.0) );
    CorpsCeleste Deimos(   0.25,  1.7, 10.0,  2.0, 4.0,  0.5,  glm::vec4(0.5, 0.5, 0.1, 1.0), false, glm::vec4(0.0, 1.0, 0.0, 1.0) );
     
    CorpsCeleste Jupiter(  1.20, 16.0, 10.0, 40.0, 0.2,  0.02, glm::vec4(1.0, 0.5, 0.5, 1.0), false, glm::vec4(0.0, 1.0, 1.0, 0.0) );
    CorpsCeleste Io(       0.20,  1.7,  5.0,  1.5, 2.5,  4.3,  glm::vec4(0.7, 0.4, 0.5, 1.0), false, glm::vec4(0.0, 1.0, 1.0, 1.0) );
    CorpsCeleste Europa(   0.25,  2.5, 87.0, 11.9, 3.5,  3.4,  glm::vec4(0.4, 0.4, 0.8, 1.0), false, glm::vec4(1.0, 0.0, 0.0, 0.0) );
    CorpsCeleste Ganymede( 0.30,  3.1, 10.0, 42.4, 4.0,  1.45, glm::vec4(0.5, 0.5, 0.1, 1.0), false, glm::vec4(1.0, 0.0, 0.0, 1.0) );
    CorpsCeleste Callisto( 0.35,  4.0, 51.0, 93.1, 1.0,  0.45, glm::vec4(0.7, 0.5, 0.1, 1.0), false, glm::vec4(1.0, 0.0, 1.0, 0.0) );
     
     
    void calculerPhysique( )
    {
       if ( etat.enmouvement )
       {
          // incrémenter rotation[] et revolution[] pour faire tourner les planètes
          Soleil.avancerPhysique();
          Terre.avancerPhysique();
          Lune.avancerPhysique();
          Mars.avancerPhysique();
          Phobos.avancerPhysique();
          Deimos.avancerPhysique();
          Jupiter.avancerPhysique();
          Io.avancerPhysique();
          Europa.avancerPhysique();
          Ganymede.avancerPhysique();
          Callisto.avancerPhysique();
       }
    }
     
    void chargerNuanceurs()
    {
       // charger le nuanceur de base
       {
          // créer le programme
          progBase = glCreateProgram();
     
          // attacher le nuanceur de sommets
          {
             GLuint nuanceurObj = glCreateShader( GL_VERTEX_SHADER );
             glShaderSource( nuanceurObj, 1, &ProgNuanceur::chainesSommetsMinimal, NULL );
             glCompileShader( nuanceurObj );
             glAttachShader( progBase, nuanceurObj );
             ProgNuanceur::afficherLogCompile( nuanceurObj );
          }
          // attacher le nuanceur de fragments
          {
             GLuint nuanceurObj = glCreateShader( GL_FRAGMENT_SHADER );
             glShaderSource( nuanceurObj, 1, &ProgNuanceur::chainesFragmentsMinimal, NULL );
             glCompileShader( nuanceurObj );
             glAttachShader( progBase, nuanceurObj );
             ProgNuanceur::afficherLogCompile( nuanceurObj );
          }
     
          // faire l'édition des liens du programme
          glLinkProgram( progBase );
          ProgNuanceur::afficherLogLink( progBase );
     
          // demander la "Location" des variables
          if ( ( locVertexBase = glGetAttribLocation( progBase, "Vertex" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de Vertex" << std::endl;
          if ( ( locColorBase = glGetAttribLocation( progBase, "Color" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de Color" << std::endl;
          if ( ( locmatrModelBase = glGetUniformLocation( progBase, "matrModel" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de matrModel" << std::endl;
          if ( ( locmatrVisuBase = glGetUniformLocation( progBase, "matrVisu" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de matrVisu" << std::endl;
          if ( ( locmatrProjBase = glGetUniformLocation( progBase, "matrProj" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de matrProj" << std::endl;
       }
     
       {
          // charger le nuanceur de ce TP
     
          // créer le programme
          prog = glCreateProgram();
     
          // attacher le nuanceur de sommets
          const GLchar *chainesSommets = ProgNuanceur::lireNuanceur( "nuanceurSommets.glsl" );
          if ( chainesSommets != NULL )
          {
             GLuint nuanceurObj = glCreateShader( GL_VERTEX_SHADER );
             glShaderSource( nuanceurObj, 1, &chainesSommets, NULL );
             glCompileShader( nuanceurObj );
             glAttachShader( prog, nuanceurObj );
             ProgNuanceur::afficherLogCompile( nuanceurObj );
             delete [] chainesSommets;
          }
    #if 1
          // partie 2:
          const GLchar *chainesGeometrie = ProgNuanceur::lireNuanceur( "nuanceurGeometrie.glsl" );
          if ( chainesGeometrie != NULL )
          {
             GLuint nuanceurObj = glCreateShader( GL_GEOMETRY_SHADER );
             glShaderSource( nuanceurObj, 1, &chainesGeometrie, NULL );
             glCompileShader( nuanceurObj );
             glAttachShader( prog, nuanceurObj );
             ProgNuanceur::afficherLogCompile( nuanceurObj );
             delete [] chainesGeometrie;
          }
    #endif
          // attacher le nuanceur de fragments
          const GLchar *chainesFragments = ProgNuanceur::lireNuanceur( "nuanceurFragments.glsl" );
          if ( chainesFragments != NULL )
          {
             GLuint nuanceurObj = glCreateShader( GL_FRAGMENT_SHADER );
             glShaderSource( nuanceurObj, 1, &chainesFragments, NULL );
             glCompileShader( nuanceurObj );
             glAttachShader( prog, nuanceurObj );
             ProgNuanceur::afficherLogCompile( nuanceurObj );
             delete [] chainesFragments;
          }
     
          // faire l'édition des liens du programme
          glLinkProgram( prog );
          ProgNuanceur::afficherLogLink( prog );
     
          // demander la "Location" des variables
          if ( ( locVertex = glGetAttribLocation( prog, "Vertex" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de Vertex" << std::endl;
          if ( ( locColor = glGetAttribLocation( prog, "Color" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de Color" << std::endl;
          if ( ( locmatrModel = glGetUniformLocation( prog, "matrModel" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de matrModel" << std::endl;
          if ( ( locmatrVisu = glGetUniformLocation( prog, "matrVisu" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de matrVisu" << std::endl;
          if ( ( locmatrProj = glGetUniformLocation( prog, "matrProj" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de matrProj" << std::endl;
          if ( ( locplanCoupe = glGetUniformLocation( prog, "planCoupe" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de planCoupe" << std::endl;
          if ( ( loccoulProfondeur = glGetUniformLocation( prog, "coulProfondeur" ) ) == -1 ) std::cerr << "!!! pas trouvé la \"Location\" de coulProfondeur" << std::endl;
       }
    }
     
    void FenetreTP::initialiser()
    {
       // donner la couleur de fond
       glClearColor( 0.1, 0.1, 0.1, 1.0 );
     
       // activer les etats openGL
       glEnable( GL_DEPTH_TEST );
     
       // activer le mélange de couleur pour la transparence
       glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
     
       // charger les nuanceurs
       chargerNuanceurs();
       glUseProgram( prog );
     
       // les valeurs à utiliser pour tracer le quad
       const GLfloat taille = Jupiter.distance + Callisto.distance + Callisto.rayon;
       GLfloat coo[] = { -taille,  taille, 0,
                          taille,  taille, 0,
                          taille, -taille, 0,
                         -taille, -taille, 0 };
       const GLuint connec[] = { 0, 1, 2, 2, 3, 0 };
     
       // partie 1: initialiser le VAO (quad)
       glBindVertexArray(vao);
       // partie 1: créer les deux VBO pour les sommets et la connectivité
     
       glGenBuffers(1,&vbo[0]);
       glBindBuffer( GL_ARRAY_BUFFER, vbo[0] );
       glBufferData( GL_ARRAY_BUFFER, sizeof(coo), coo, GL_STATIC_DRAW);
       glVertexAttribPointer( locVertex, 3, GL_FLOAT, GL_FALSE, 0, 0 );
       glEnableVertexAttribArray(locVertex);
     
       glGenBuffers(1,&vbo[1]);
       glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, vbo[1] );
       glBufferData( GL_ELEMENT_ARRAY_BUFFER, sizeof(connec), connec, GL_STATIC_DRAW);
     
       glBindVertexArray(0);
     
       // construire le graphe de scène
       Soleil.ajouteEnfant(Terre);
       Terre.ajouteEnfant(Lune);
     
       Soleil.ajouteEnfant(Mars);
       Mars.ajouteEnfant(Phobos);
       Mars.ajouteEnfant(Deimos);
     
       Soleil.ajouteEnfant(Jupiter);
       Jupiter.ajouteEnfant(Io);
       Jupiter.ajouteEnfant(Europa);
       Jupiter.ajouteEnfant(Ganymede);
       Jupiter.ajouteEnfant(Callisto);
     
       // créer quelques autres formes
       cube = new FormeCube( 1.5 );
       sphere = new FormeSphere( 1.0, 16, 16 );
       theiere = new FormeTheiere( );
       toreTerre = new FormeTore( 0.08, Terre.distance, 8, 200 );
       toreMars = new FormeTore( 0.08, Mars.distance, 8, 200 );
       toreJupiter = new FormeTore( 0.08, Jupiter.distance, 8, 200 );
    }
     
    void FenetreTP::conclure()
    {
       delete cube;
       delete sphere;
       delete theiere;
       delete toreTerre;
       delete toreMars;
       delete toreJupiter;
       glDeleteBuffers( 2, vbo );
       glDeleteVertexArrays( 1, &vao );
    }
     
    void afficherQuad( GLfloat alpha ) // le plan qui ferme les solides
    {
       glVertexAttrib4f( locColor, 1.0, 1.0, 1.0, alpha );
       // afficher le plan tourné selon l'angle courant et à la position courante
       // partie 1: modifs ici ...
       // ...
     
       matrModel.Rotate(etat.angleCoupe, 0.0, 1.0, 0.0);
       matrModel.Translate(etat.planCoupe.x,etat.planCoupe.y,-etat.planCoupe.w);
       glUniformMatrix4fv( locmatrModel, 1, GL_FALSE, matrModel );
       glBindVertexArray( vao );
       glDrawElements( GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0 );
       glBindVertexArray(0);
       // ...
    }
     
    void afficherModele()
    {
       glVertexAttrib4f( locColor, 1.0, 1.0, 1.0, 1.0 );
     
    #if 1
       // afficher les deux tores pour identifier les orbites des planetes
       glVertexAttrib3f( locColor, 0.0, 0.0, 1.0 );
       toreTerre->afficher();
       glVertexAttrib3f( locColor, 0.0, 1.0, 0.0 );
       toreMars->afficher();
       glVertexAttrib3f( locColor, 1.0, 0.0, 0.0 );
       toreJupiter->afficher();
    #endif
     
       // afficher le système solaire en commençant à la racine
       Soleil.afficher( );
    }
     
    void FenetreTP::afficherScene( )
    {
       // effacer l'ecran et le tampon de profondeur et le stencil
       glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
     
       glUseProgram( progBase );
     
       // définir le pipeline graphique
       matrProj.Perspective( 50.0, (GLdouble) largeur_ / (GLdouble) hauteur_, 0.1, 100.0 );
       glUniformMatrix4fv( locmatrProjBase, 1, GL_FALSE, matrProj );
     
       camera.definir();
       glUniformMatrix4fv( locmatrVisuBase, 1, GL_FALSE, matrVisu );
     
       matrModel.LoadIdentity();
       glUniformMatrix4fv( locmatrModelBase, 1, GL_FALSE, matrModel );
     
       // afficher les axes
       if ( etat.afficheAxes ) FenetreTP::afficherAxes();
     
       // dessiner la scène
       glUseProgram( prog );
       glUniformMatrix4fv( locmatrProj, 1, GL_FALSE, matrProj );
       glUniformMatrix4fv( locmatrVisu, 1, GL_FALSE, matrVisu );
       glUniformMatrix4fv( locmatrModel, 1, GL_FALSE, matrModel );
       glUniform4fv( locplanCoupe, 1, glm::value_ptr(etat.planCoupe) );
       glUniform1i( loccoulProfondeur, etat.coulProfondeur );
     
     
       // afficher le modèle et tenir compte du stencil et du plan de coupe
       // partie 1: modifs ici ...
     
       if (!etat.modeSelection)
       {
           glEnable(GL_STENCIL_TEST);
           glStencilFunc(GL_ALWAYS,1,1);
           glStencilOp(GL_KEEP,GL_KEEP,GL_INCR);
           glEnable(GL_CLIP_PLANE0);
           glDepthMask(GL_FALSE);
           glEnable(GL_BLEND);
           glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     
           afficherModele();
     
           glDisable(GL_CLIP_PLANE0);
     
           matrModel.PushMatrix();
           afficherQuad(0.25);
     
           glDisable(GL_BLEND);
           glDepthMask(GL_TRUE);
           glStencilFunc(GL_EQUAL,2,1);
     
           matrModel.PopMatrix();
           afficherQuad(0.25);
     
           glDisable(GL_STENCIL_TEST);
     
       }
       else
       {
     
           afficherModele();
     
           glFinish();
     
           //obtenir position
           GLint cloture[4]; glGetIntegerv( GL_VIEWPORT, cloture );
           GLint posX = etat.sourisPosPrec.x, posY = cloture[3]-etat.sourisPosPrec.y;
     
           glReadBuffer(GL_BACK);
     
           //obtenir couleur a la position obtenue
           GLubyte couleur[4];
           glReadPixels( posX, posY, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, couleur );
     
     
           if (couleur[0] == 0 && couleur[1] == 0 && couleur[2] == 0 && couleur[3] == 0)
               Soleil.estSelectionne = !Soleil.estSelectionne;
           else if (couleur[0] == 0 && couleur[1] == 0 && couleur[2] == 0 && couleur[3] != 0)
               Terre.estSelectionne = !Terre.estSelectionne;
           else if (couleur[0] == 0 && couleur[1] == 0 && couleur[2] != 0 && couleur[3] == 0)
               Lune.estSelectionne = !Lune.estSelectionne;
           else if (couleur[0] == 0 && couleur[1] == 0 && couleur[2] != 0 && couleur[3] != 0)
               Mars.estSelectionne = !Mars.estSelectionne;
           else if (couleur[0] == 0 && couleur[1] != 0 && couleur[2] == 0 && couleur[3] == 0)
               Phobos.estSelectionne = !Phobos.estSelectionne;
           else if (couleur[0] == 0 && couleur[1] != 0 && couleur[2] == 0 && couleur[3] != 0)
               Deimos.estSelectionne = !Deimos.estSelectionne;
           else if (couleur[0] == 0 && couleur[1] != 0 && couleur[2] != 0 && couleur[3] == 0)
               Jupiter.estSelectionne = !Jupiter.estSelectionne;
           else if (couleur[0] == 0 && couleur[1] != 0 && couleur[2] != 0 && couleur[3] != 0)
               Io.estSelectionne = !Io.estSelectionne;
           else if (couleur[0] != 0 && couleur[1] == 0 && couleur[2] == 0 && couleur[3] == 0)
               Europa.estSelectionne = !Europa.estSelectionne;
           else if (couleur[0] != 0 && couleur[1] == 0 && couleur[2] == 0 && couleur[3] != 0)
               Ganymede.estSelectionne = !Ganymede.estSelectionne;
           else if (couleur[0] != 0 && couleur[1] == 0 && couleur[2] != 0 && couleur[3] == 0)
               Callisto.estSelectionne = !Callisto.estSelectionne;
     
     
       }
     
    }
     
    void FenetreTP::redimensionner( GLsizei w, GLsizei h )
    {
      // glViewport( 0, 0, w, h );
     
       GLfloat h2 = 0.5*h;
       glViewport( 0, 0, w, h2 ); // pour le viewport 0
       glViewportIndexedf( 1,  0, h2, w, h2 ); // pour le viewport 1
       glScissorIndexed(   1,  0, h2, w, h2 );
    }
     
    void FenetreTP::clavier( TP_touche touche )
    {
       switch ( touche )
       {
       case TP_ECHAP:
       case TP_q: // Quitter l'application
          quit();
          break;
     
       case TP_x: // Activer/désactiver l'affichage des axes
          etat.afficheAxes = !etat.afficheAxes;
          std::cout << "// Affichage des axes ? " << ( etat.afficheAxes ? "OUI" : "NON" ) << std::endl;
          break;
     
       case TP_v: // Recharger les fichiers des nuanceurs et recréer le programme
          chargerNuanceurs();
          std::cout << "// Recharger nuanceurs" << std::endl;
          break;
     
       case TP_ESPACE: // Mettre en pause ou reprendre l'animation
          etat.enmouvement = !etat.enmouvement;
          break;
     
       case TP_g: // Permuter l'affichage en fil de fer ou plein
          etat.modePolygone = ( etat.modePolygone == GL_FILL ) ? GL_LINE : GL_FILL;
          glPolygonMode( GL_FRONT_AND_BACK, etat.modePolygone );
          break;
     
       case TP_m: // Choisir le modèle: 1-sphère, 2-cube, 3-théière (déjà implanté)
          if ( ++etat.modele > 3 ) etat.modele = 1;
          std::cout << " etat.modele=" << etat.modele << std::endl;
          break;
     
       case TP_p: // Atténuer ou non la couleur selon la profondeur
          etat.coulProfondeur = !etat.coulProfondeur;
          std::cout << " etat.coulProfondeur=" << etat.coulProfondeur << std::endl;
          break;
     
       case TP_HAUT: // Déplacer le plan de coupe vers le haut
          etat.planCoupe.w += 0.1;
          std::cout << " etat.planCoupe.w=" << etat.planCoupe.w << std::endl;
          break;
     
       case TP_BAS: // Déplacer le plan de coupe vers le bas
          etat.planCoupe.w -= 0.1;
          std::cout << " etat.planCoupe.w=" << etat.planCoupe.w << std::endl;
          break;
     
       case TP_CROCHETDROIT:
       case TP_DROITE: // Augmenter l'angle du plan de coupe
          etat.angleCoupe += 0.5;
          etat.planCoupe.x = sin(glm::radians(etat.angleCoupe));
          etat.planCoupe.z = cos(glm::radians(etat.angleCoupe));
          std::cout << " etat.angleCoupe=" << etat.angleCoupe << std::endl;
          break;
       case TP_CROCHETGAUCHE:
       case TP_GAUCHE: // Diminuer l'angle du plan de coupe
          etat.angleCoupe -= 0.5;
          etat.planCoupe.x = sin(glm::radians(etat.angleCoupe));
          etat.planCoupe.z = cos(glm::radians(etat.angleCoupe));
          std::cout << " etat.angleCoupe=" << etat.angleCoupe << std::endl;
          break;
     
       // case TP_c: // Augmenter le facteur de réchauffement
       //    etat.facteurRechauffement += 0.05; if ( etat.facteurRechauffement > 1.0 ) etat.facteurRechauffement = 1.0;
       //    std::cout << " etat.facteurRechauffement=" << etat.facteurRechauffement << " " << std::endl;
       //    break;
       // case TP_f: // Diminuer le facteur de réchauffement
       //    etat.facteurRechauffement -= 0.05; if ( etat.facteurRechauffement < 0.0 ) etat.facteurRechauffement = 0.0;
       //    std::cout << " etat.facteurRechauffement=" << etat.facteurRechauffement << " " << std::endl;
       //    break;
     
       case TP_PLUS: // Incrémenter la distance de la caméra
       case TP_EGAL:
          camera.dist--;
          std::cout << " camera.dist=" << camera.dist << std::endl;
          break;
     
       case TP_SOULIGNE:
       case TP_MOINS: // Décrémenter la distance de la caméra
          camera.dist++;
          std::cout << " camera.dist=" << camera.dist << std::endl;
          break;
     
       default:
          std::cout << " touche inconnue : " << (char) touche << std::endl;
          imprimerTouches();
          break;
       }
    }
     
    static bool pressed = false;
    void FenetreTP::sourisClic( int button, int state, int x, int y )
    {
       pressed = ( state == TP_PRESSE );
       if ( pressed )
       {
          switch ( button )
          {
          default:
          case TP_BOUTON_GAUCHE: // Modifier le point de vue
             etat.modeSelection = false;
             break;
          case TP_BOUTON_DROIT: // Sélectionner des objets
             etat.modeSelection = true;
             break;
          }
          etat.sourisPosPrec.x = x;
          etat.sourisPosPrec.y = y;
       }
       else
       {
          etat.modeSelection = false;
       }
    }
     
    void FenetreTP::sourisWheel( int x, int y ) // Déplacer le plan de coupe
    {
       const int sens = +1;
       etat.planCoupe.w += 0.02 * sens * y;
       std::cout << " etat.planCoupe.w=" << etat.planCoupe.w << std::endl;
    }
     
    void FenetreTP::sourisMouvement( int x, int y )
    {
       if ( pressed )
       {
          if ( !etat.modeSelection )
          {
             int dx = x - etat.sourisPosPrec.x;
             int dy = y - etat.sourisPosPrec.y;
             camera.theta -= dx / 3.0;
             camera.phi   -= dy / 3.0;
          }
     
          etat.sourisPosPrec.x = x;
          etat.sourisPosPrec.y = y;
     
          camera.verifierAngles();
       }
    }
     
    int main( int argc, char *argv[] )
    {
       // créer une fenêtre
       FenetreTP fenetre( "INF2705 TP" );
     
       // allouer des ressources et définir le contexte OpenGL
       fenetre.initialiser();
     
       bool boucler = true;
       while ( boucler )
       {
          // mettre à jour la physique
          calculerPhysique( );
     
          // affichage
          fenetre.afficherScene();
     
     
          if ( etat.modeSelection )
          {
             etat.modeSelection = pressed = false;
          }
          else
             fenetre.swap();
     
     
          // récupérer les événements et appeler la fonction de rappel
          boucler = fenetre.gererEvenement();
     
       }
     
       // détruire les ressources OpenGL allouées
       fenetre.conclure();
     
       return 0;
    }
    et une partie des erreurs parce que la liste dépasse la console
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
     
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:92:29: note: ‘template<class genType> genType glm::two_over_root_pi()’ previously declared here
      GLM_FUNC_QUALIFIER genType two_over_root_pi()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:122:43: error: redefinition of ‘template<class genType> genType glm::one_over_root_two()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_root_two()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:98:29: note: ‘template<class genType> genType glm::one_over_root_two()’ previously declared here
      GLM_FUNC_QUALIFIER genType one_over_root_two()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:128:43: error: redefinition of ‘template<class genType> genType glm::root_half_pi()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_half_pi()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:104:29: note: ‘template<class genType> genType glm::root_half_pi()’ previously declared here
      GLM_FUNC_QUALIFIER genType root_half_pi()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:134:43: error: redefinition of ‘template<class genType> genType glm::root_two_pi()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two_pi()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:110:29: note: ‘template<class genType> genType glm::root_two_pi()’ previously declared here
      GLM_FUNC_QUALIFIER genType root_two_pi()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:140:43: error: redefinition of ‘template<class genType> genType glm::root_ln_four()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_ln_four()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:116:29: note: ‘template<class genType> genType glm::root_ln_four()’ previously declared here
      GLM_FUNC_QUALIFIER genType root_ln_four()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:146:43: error: redefinition of ‘template<class genType> genType glm::e()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType e()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:122:29: note: ‘template<class genType> genType glm::e()’ previously declared here
      GLM_FUNC_QUALIFIER genType e()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:152:43: error: redefinition of ‘template<class genType> genType glm::euler()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType euler()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:128:29: note: ‘template<class genType> genType glm::euler()’ previously declared here
      GLM_FUNC_QUALIFIER genType euler()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:158:43: error: redefinition of ‘template<class genType> genType glm::root_two()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:134:29: note: ‘template<class genType> genType glm::root_two()’ previously declared here
      GLM_FUNC_QUALIFIER genType root_two()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:164:43: error: redefinition of ‘template<class genType> genType glm::root_three()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_three()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:140:29: note: ‘template<class genType> genType glm::root_three()’ previously declared here
      GLM_FUNC_QUALIFIER genType root_three()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:170:43: error: redefinition of ‘template<class genType> genType glm::root_five()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_five()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:146:29: note: ‘template<class genType> genType glm::root_five()’ previously declared here
      GLM_FUNC_QUALIFIER genType root_five()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:176:43: error: redefinition of ‘template<class genType> genType glm::ln_two()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_two()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:152:29: note: ‘template<class genType> genType glm::ln_two()’ previously declared here
      GLM_FUNC_QUALIFIER genType ln_two()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:182:43: error: redefinition of ‘template<class genType> genType glm::ln_ten()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ten()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:158:29: note: ‘template<class genType> genType glm::ln_ten()’ previously declared here
      GLM_FUNC_QUALIFIER genType ln_ten()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:188:43: error: redefinition of ‘template<class genType> genType glm::ln_ln_two()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ln_two()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:164:29: note: ‘template<class genType> genType glm::ln_ln_two()’ previously declared here
      GLM_FUNC_QUALIFIER genType ln_ln_two()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:194:43: error: redefinition of ‘template<class genType> genType glm::third()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType third()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:170:29: note: ‘template<class genType> genType glm::third()’ previously declared here
      GLM_FUNC_QUALIFIER genType third()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:200:43: error: redefinition of ‘template<class genType> genType glm::two_thirds()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_thirds()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:176:29: note: ‘template<class genType> genType glm::two_thirds()’ previously declared here
      GLM_FUNC_QUALIFIER genType two_thirds()
                                 ^
    In file included from /usr/include/glm/gtc/constants.hpp:205:0,
                     from /usr/include/glm/gtx/quaternion.hpp:47,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/constants.inl:206:43: error: redefinition of ‘template<class genType> genType glm::golden_ratio()’
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType golden_ratio()
                                               ^
    In file included from /usr/local/include/glm/gtc/constants.hpp:184:0,
                     from /usr/local/include/glm/gtc/quaternion.hpp:46,
                     from /usr/local/include/glm/gtc/type_ptr.hpp:65,
                     from inf2705-matrice.h:18,
                     from main.cpp:8:
    /usr/local/include/glm/gtc/constants.inl:182:29: note: ‘template<class genType> genType glm::golden_ratio()’ previously declared here
      GLM_FUNC_QUALIFIER genType golden_ratio()
                                 ^
    In file included from /usr/include/glm/gtc/quaternion.hpp:382:0,
                     from /usr/include/glm/gtx/quaternion.hpp:48,
                     from /usr/include/glm/gtx/io.hpp:51,
                     from main.cpp:12:
    /usr/include/glm/gtc/quaternion.inl:42:32: error: type/value mismatch at argument 1 in template parameter list fortemplate<template<class,glm::precision <anonymous> > class vecType, class T, glm::precision P> struct glm::detail::compute_dot’
      struct compute_dot<tquat, T, P>
                                    ^
    /usr/include/glm/gtc/quaternion.inl:42:32: note:   expected a template of type ‘template<class, glm::precision <anonymous> > class vecType’,got ‘template<class T> struct glm::detail::tquat’
    main.cpp: In member function ‘void Camera::definir()’:
    main.cpp:74:51: error: call of overloaded ‘radians(double&)’ is ambiguous
           matrVisu.LookAt( dist*cos(glm::radians(theta))*sin(glm::radians(phi)),
                                                       ^
    In file included from /usr/local/include/glm/core/func_trigonometric.hpp:199:0,
                     from /usr/local/include/glm/glm.hpp:100,
                     from inf2705-matrice.h:17,
                     from main.cpp:8:
    /usr/local/include/glm/core/func_trigonometric.inl:33:29: note: candidate: genType glm::radians(const genType&) [with genType = double]
      GLM_FUNC_QUALIFIER genType radians
                                 ^
    In file included from /usr/include/glm/detail/func_trigonometric.hpp:205:0,
                     from /usr/include/glm/trigonometric.hpp:35,
                     from /usr/include/glm/glm.hpp:110,
                     from /usr/include/glm/gtx/io.hpp:50,
                     from main.cpp:12:
    /usr/include/glm/detail/func_trigonometric.inl:41:43: note: candidate: genType glm::radians(genType) [with genType = double]
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
                                               ^
    main.cpp:74:74: error: call of overloaded ‘radians(double&)’ is ambiguous
           matrVisu.LookAt( dist*cos(glm::radians(theta))*sin(glm::radians(phi)),
                                                                              ^
    In file included from /usr/local/include/glm/core/func_trigonometric.hpp:199:0,
                     from /usr/local/include/glm/glm.hpp:100,
                     from inf2705-matrice.h:17,
                     from main.cpp:8:
    /usr/local/include/glm/core/func_trigonometric.inl:33:29: note: candidate: genType glm::radians(const genType&) [with genType = double]
      GLM_FUNC_QUALIFIER genType radians
                                 ^
    In file included from /usr/include/glm/detail/func_trigonometric.hpp:205:0,
                     from /usr/include/glm/trigonometric.hpp:35,
                     from /usr/include/glm/glm.hpp:110,
                     from /usr/include/glm/gtx/io.hpp:50,
                     from main.cpp:12:
    /usr/include/glm/detail/func_trigonometric.inl:41:43: note: candidate: genType glm::radians(genType) [with genType = double]
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
                                               ^
    main.cpp:75:51: error: call of overloaded ‘radians(double&)’ is ambiguous
                            dist*sin(glm::radians(theta))*sin(glm::radians(phi)),
                                                       ^
    In file included from /usr/local/include/glm/core/func_trigonometric.hpp:199:0,
                     from /usr/local/include/glm/glm.hpp:100,
                     from inf2705-matrice.h:17,
                     from main.cpp:8:
    /usr/local/include/glm/core/func_trigonometric.inl:33:29: note: candidate: genType glm::radians(const genType&) [with genType = double]
      GLM_FUNC_QUALIFIER genType radians
                                 ^
    In file included from /usr/include/glm/detail/func_trigonometric.hpp:205:0,
                     from /usr/include/glm/trigonometric.hpp:35,
                     from /usr/include/glm/glm.hpp:110,
                     from /usr/include/glm/gtx/io.hpp:50,
                     from main.cpp:12:
    /usr/include/glm/detail/func_trigonometric.inl:41:43: note: candidate: genType glm::radians(genType) [with genType = double]
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
                                               ^
    main.cpp:75:74: error: call of overloaded ‘radians(double&)’ is ambiguous
                            dist*sin(glm::radians(theta))*sin(glm::radians(phi)),
                                                                              ^
    In file included from /usr/local/include/glm/core/func_trigonometric.hpp:199:0,
                     from /usr/local/include/glm/glm.hpp:100,
                     from inf2705-matrice.h:17,
                     from main.cpp:8:
    /usr/local/include/glm/core/func_trigonometric.inl:33:29: note: candidate: genType glm::radians(const genType&) [with genType = double]
      GLM_FUNC_QUALIFIER genType radians
                                 ^
    In file included from /usr/include/glm/detail/func_trigonometric.hpp:205:0,
                     from /usr/include/glm/trigonometric.hpp:35,
                     from /usr/include/glm/glm.hpp:110,
                     from /usr/include/glm/gtx/io.hpp:50,
                     from main.cpp:12:
    /usr/include/glm/detail/func_trigonometric.inl:41:43: note: candidate: genType glm::radians(genType) [with genType = double]
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
                                               ^
    main.cpp:76:49: error: call of overloaded ‘radians(double&)’ is ambiguous
                            dist*cos(glm::radians(phi)),
                                                     ^
    In file included from /usr/local/include/glm/core/func_trigonometric.hpp:199:0,
                     from /usr/local/include/glm/glm.hpp:100,
                     from inf2705-matrice.h:17,
                     from main.cpp:8:
    /usr/local/include/glm/core/func_trigonometric.inl:33:29: note: candidate: genType glm::radians(const genType&) [with genType = double]
      GLM_FUNC_QUALIFIER genType radians
                                 ^
    In file included from /usr/include/glm/detail/func_trigonometric.hpp:205:0,
                     from /usr/include/glm/trigonometric.hpp:35,
                     from /usr/include/glm/glm.hpp:110,
                     from /usr/include/glm/gtx/io.hpp:50,
                     from main.cpp:12:
    /usr/include/glm/detail/func_trigonometric.inl:41:43: note: candidate: genType glm::radians(genType) [with genType = double]
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
                                               ^
    main.cpp: In member function ‘void Camera::verifierAngles()’:
    main.cpp:85:45: error: call of overloaded ‘clamp(double&, const GLdouble&, const GLdouble&)’ is ambiguous
           phi = glm::clamp( phi, MINPHI, MAXPHI );
                                                 ^
    In file included from /usr/local/include/glm/core/func_common.hpp:428:0,
                     from /usr/local/include/glm/glm.hpp:102,
                     from inf2705-matrice.h:17,
                     from main.cpp:8:
    /usr/local/include/glm/core/func_common.inl:323:29: note: candidate: genType glm::clamp(const genType&, const genType&, const genType&) [with genType = double]
      GLM_FUNC_QUALIFIER valType clamp
                                 ^
    In file included from /usr/include/glm/detail/func_common.hpp:455:0,
                     from /usr/include/glm/common.hpp:35,
                     from /usr/include/glm/glm.hpp:112,
                     from /usr/include/glm/gtx/io.hpp:50,
                     from main.cpp:12:
    /usr/include/glm/detail/func_common.inl:451:29: note: candidate: genType glm::clamp(genType, genType, genType) [with genType = double]
      GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal)
                                 ^
    main.cpp: In member function ‘void FenetreTP::clavier(TP_touche)’:
    main.cpp:591:58: error: call of overloaded ‘radians(GLfloat&)’ is ambiguous
           etat.planCoupe.x = sin(glm::radians(etat.angleCoupe));
                                                              ^
    In file included from /usr/local/include/glm/core/func_trigonometric.hpp:199:0,
                     from /usr/local/include/glm/glm.hpp:100,
                     from inf2705-matrice.h:17,
                     from main.cpp:8:
    /usr/local/include/glm/core/func_trigonometric.inl:33:29: note: candidate: genType glm::radians(const genType&) [with genType = float]
      GLM_FUNC_QUALIFIER genType radians
                                 ^
    In file included from /usr/include/glm/detail/func_trigonometric.hpp:205:0,
                     from /usr/include/glm/trigonometric.hpp:35,
                     from /usr/include/glm/glm.hpp:110,
                     from /usr/include/glm/gtx/io.hpp:50,
                     from main.cpp:12:
    /usr/include/glm/detail/func_trigonometric.inl:41:43: note: candidate: genType glm::radians(genType) [with genType = float]
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
                                               ^
    main.cpp:592:58: error: call of overloaded ‘radians(GLfloat&)’ is ambiguous
           etat.planCoupe.z = cos(glm::radians(etat.angleCoupe));
                                                              ^
    In file included from /usr/local/include/glm/core/func_trigonometric.hpp:199:0,
                     from /usr/local/include/glm/glm.hpp:100,
                     from inf2705-matrice.h:17,
                     from main.cpp:8:
    /usr/local/include/glm/core/func_trigonometric.inl:33:29: note: candidate: genType glm::radians(const genType&) [with genType = float]
      GLM_FUNC_QUALIFIER genType radians
                                 ^
    In file included from /usr/include/glm/detail/func_trigonometric.hpp:205:0,
                     from /usr/include/glm/trigonometric.hpp:35,
                     from /usr/include/glm/glm.hpp:110,
                     from /usr/include/glm/gtx/io.hpp:50,
                     from main.cpp:12:
    /usr/include/glm/detail/func_trigonometric.inl:41:43: note: candidate: genType glm::radians(genType) [with genType = float]
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
                                               ^
    main.cpp:598:58: error: call of overloaded ‘radians(GLfloat&)’ is ambiguous
           etat.planCoupe.x = sin(glm::radians(etat.angleCoupe));
                                                              ^
    In file included from /usr/local/include/glm/core/func_trigonometric.hpp:199:0,
                     from /usr/local/include/glm/glm.hpp:100,
                     from inf2705-matrice.h:17,
                     from main.cpp:8:
    /usr/local/include/glm/core/func_trigonometric.inl:33:29: note: candidate: genType glm::radians(const genType&) [with genType = float]
      GLM_FUNC_QUALIFIER genType radians
                                 ^
    In file included from /usr/include/glm/detail/func_trigonometric.hpp:205:0,
                     from /usr/include/glm/trigonometric.hpp:35,
                     from /usr/include/glm/glm.hpp:110,
                     from /usr/include/glm/gtx/io.hpp:50,
                     from main.cpp:12:
    /usr/include/glm/detail/func_trigonometric.inl:41:43: note: candidate: genType glm::radians(genType) [with genType = float]
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
                                               ^
    main.cpp:599:58: error: call of overloaded ‘radians(GLfloat&)’ is ambiguous
           etat.planCoupe.z = cos(glm::radians(etat.angleCoupe));
                                                              ^
    In file included from /usr/local/include/glm/core/func_trigonometric.hpp:199:0,
                     from /usr/local/include/glm/glm.hpp:100,
                     from inf2705-matrice.h:17,
                     from main.cpp:8:
    /usr/local/include/glm/core/func_trigonometric.inl:33:29: note: candidate: genType glm::radians(const genType&) [with genType = float]
      GLM_FUNC_QUALIFIER genType radians
                                 ^
    In file included from /usr/include/glm/detail/func_trigonometric.hpp:205:0,
                     from /usr/include/glm/trigonometric.hpp:35,
                     from /usr/include/glm/glm.hpp:110,
                     from /usr/include/glm/gtx/io.hpp:50,
                     from main.cpp:12:
    /usr/include/glm/detail/func_trigonometric.inl:41:43: note: candidate: genType glm::radians(genType) [with genType = float]
      GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
                                               ^
    makefile:22: recipe for target 'main.exe' failed
    make: *** [main.exe] Error 1
    J'ai pas mal scruté les tutos les plus populaires pour installer openGl, du coup je pense que j'ai taper pas mal tous les commandes de base pour installer openGl, j'ai même suivi un tuto pour installer des drivers AMD parce que ma carte graphique est intel. Un de mes coéquipiers m'avait dit qu'il avait réussit à l'installer en updatant les drivers de sa carte graphique, du coup je pense que ça doit être possible. Ça m'a l'air d'être un problème avec libglm-dev?

    Merci d'avance.

  2. #2
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    26 859
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 26 859
    Points : 218 580
    Points
    218 580
    Billets dans le blog
    120
    Par défaut
    Bonjour,

    Quel compilateur utilisez vous et en quelle version ?
    Il serait aussi intéressant d'avoir le contenu du fichier : inf2705-matrice.h .
    Vous souhaitez participer à la rubrique 2D/3D/Jeux ? Contactez-moi

    Ma page sur DVP
    Mon Portfolio

    Qui connaît l'erreur, connaît la solution.

  3. #3
    Futur Membre du Club
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    10
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2010
    Messages : 10
    Points : 9
    Points
    9
    Par défaut
    Oui j'utilise aussi Ubuntu 16.04 et le compilateur:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    $dpkg -l libglm-dev  g++
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name           Version      Architecture Description
    +++-==============-============-============-=================================
    ii  g++            4:5.3.1-1ubu amd64        GNU C++ compiler
    ii  libglm-dev     0.9.7.2-1    all          C++ library for OpenGL GLSL type-
     
    $gcc --version
    gcc (Ubuntu 5.4.0-6ubuntu1~16.04.6) 5.4.0 20160609
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    #ifndef INF2705_MATRICE_H
    #define INF2705_MATRICE_H
     
    ////////////////////////////////////////////////////////////////////////////
    //
    // Classe pour les matrices du pipeline
    //						(INF2705, Benoît Ozell)
    ////////////////////////////////////////////////////////////////////////////
     
    #include <GL/glew.h>
    #include <iostream>
     
    // #define GLM_SWIZZLE
    // // (à compter de GLM 9.8, c'est plutôt la variable ci-dessous qu'il faut définir)
    // #define GLM_FORCE_SWIZZLE
    #define GLM_FORCE_RADIANS 1
    #include <glm/glm.hpp>
    #include <glm/gtc/type_ptr.hpp>
    #include <glm/gtc/matrix_transform.hpp>
    #include <glm/gtx/string_cast.hpp>
    #include <stack>
     
    class MatricePipeline
    {
    public:
       MatricePipeline()
       { matr_.push( glm::mat4(1.0) ); }
     
       operator glm::mat4() const { return matr_.top(); }
       operator const GLfloat*() const { return glm::value_ptr(matr_.top()); }
     
       void LoadIdentity()
       { matr_.top() = glm::mat4(1.0); }
       // Note: la librairie glm s’occupe de convertir les glm::vec3 en glm::vec4 pour la multiplication par glm::mat4 matr_.
       void Scale( GLfloat sx, GLfloat sy, GLfloat sz )
       { matr_.top() = glm::scale( matr_.top(), glm::vec3(sx,sy,sz) ); }
       void Translate( GLfloat tx, GLfloat ty, GLfloat tz )
       { matr_.top() = glm::translate( matr_.top(), glm::vec3(tx,ty,tz) ); }
       void Rotate( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
       { matr_.top() = glm::rotate( matr_.top(), (GLfloat)glm::radians(angle), glm::vec3(x,y,z) ); }
     
       void LookAt( GLdouble obsX, GLdouble obsY, GLdouble obsZ, GLdouble versX, GLdouble versY, GLdouble versZ, GLdouble upX, GLdouble upY, GLdouble upZ )
       { matr_.top() = glm::lookAt( glm::vec3( obsX, obsY, obsZ ), glm::vec3( versX, versY, versZ ), glm::vec3( upX, upY, upZ ) ); }
       void Frustum( GLdouble gauche, GLdouble droite, GLdouble bas, GLdouble haut, GLdouble planAvant, GLdouble planArriere )
       { matr_.top() = glm::frustum( gauche, droite, bas, haut, planAvant, planArriere ); }
       void Perspective( GLdouble fovy, GLdouble aspect, GLdouble planAvant, GLdouble planArriere )
       { matr_.top() = glm::perspective( glm::radians(fovy), aspect, planAvant, planArriere );}
       void Ortho( GLdouble gauche, GLdouble droite, GLdouble bas, GLdouble haut, GLdouble planAvant, GLdouble planArriere )
       { matr_.top() = glm::ortho( gauche, droite, bas, haut, planAvant, planArriere ); }
       void Ortho2D( GLdouble gauche, GLdouble droite, GLdouble bas, GLdouble haut )
       { matr_.top() = glm::ortho( gauche, droite, bas, haut ); }
     
       void PushMatrix()
       { matr_.push( matr_.top() ); }
       void PopMatrix()
       { matr_.pop(); }
     
       glm::mat4 getMatr()
       { return matr_.top(); }
       glm::mat4 setMatr( glm::mat4 m )
       { return( matr_.top() = m ); }
     
       friend std::ostream& operator<<( std::ostream& o, const MatricePipeline& mp )
       {
          //return o << glm::to_string(mp.matr_.top());
          glm::mat4 m = mp.matr_.top(); //o.precision(3); o.width(6);
          return o << std::endl
                   << "   " << m[0][0] << " " << m[1][0] << " " << m[2][0] << " " << m[3][0] << std::endl
                   << "   " << m[0][1] << " " << m[1][1] << " " << m[2][1] << " " << m[3][1] << std::endl
                   << "   " << m[0][2] << " " << m[1][2] << " " << m[2][2] << " " << m[3][2] << std::endl
                   << "   " << m[0][3] << " " << m[1][3] << " " << m[2][3] << " " << m[3][3] << std::endl;
       }
     
    private:
       std::stack<glm::mat4> matr_;
    };
     
    #endif

  4. #4
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    26 859
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 26 859
    Points : 218 580
    Points
    218 580
    Billets dans le blog
    120
    Par défaut
    Ah ! J'ai enfin compris. Vous avez deux installation de GLM en parallèle :
    • /usr/include/glm
    • /usr/local/include/glm

    Du coup, les inclusions rentrent en conflit. En désinstallant l'une (celle provenant des paquets sera la plus simple à désinstaller) cela devrait fonctionner.
    Vous souhaitez participer à la rubrique 2D/3D/Jeux ? Contactez-moi

    Ma page sur DVP
    Mon Portfolio

    Qui connaît l'erreur, connaît la solution.

Discussions similaires

  1. Réponses: 3
    Dernier message: 09/04/2015, 11h01
  2. Erreur lors de la compilation de MySQL
    Par webrider dans le forum SUSE
    Réponses: 2
    Dernier message: 06/03/2007, 11h21
  3. Erreur lors de la compilation avec OmniORB
    Par JohnKwada dans le forum CORBA
    Réponses: 1
    Dernier message: 07/09/2006, 17h34
  4. erreur lors de la compilation
    Par ksoft dans le forum MFC
    Réponses: 2
    Dernier message: 02/05/2006, 15h40
  5. Réponses: 4
    Dernier message: 22/02/2006, 14h11

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo