Code pour commencer les TP d'animation de personnage en C++ (en M1 et M2)

Les fichiers à recupérer

Le code se base sur gkit2light (une branche) et se récupère avec Git comme ceci:

git clone -b master_CharAnim https://forge.univ-lyon1.fr/Alexandre.Meyer/gkit2light.git gkit2light-master_CharAnim

qui fait un clone du dépôt gkit2light, branche master_CharAnim et range le tout dans le répertoire gkit2light-master_CharAnim

ou alors 

git clone https://forge.univ-lyon1.fr/Alexandre.Meyer/gkit2light.git gkit2light-master_CharAnim
cd gkit2light-master_CharAnim
git checkout master_CharAnim
=> le update avec un nom de branche permet de passer dans une autre branche


Il est possible que la forge vous fasse une erreur de certificat, dans ce cas regardez ici.

Pour compiler sous Linux avec codeblocks

cd gkit2light-master_CharAnim
premake4 --file=master_CharAnim.lua codeblocks
ouvrir le projet  master_CharAnim.cbp


Pour compiler sous Linux avec make

cd gkit2light
premake4 --file=master_CharAnim.lua gmake
make -f master_CharAnim.make ou juste make
bin/master_CharAnim


Pour compiler sous Linux de chez vous (ubuntu)


Pour compiler sous windows chez vous avec CodeBlocks ou VisualStudio

  • Installez Git
  • Installez Codeblocks avec Mingw OU Visual Studio
  • Explorateur de fichier, placez vous dans le répertoire de vos fichiers, bouton droit “git bash here” puis le clone indiqué plus haut …
    • copiez le répertoire 'extern' dans le répertoire principal de gkit2light
    • Vous devez aussi copier toutes les .dll du répertoire extern/mingw/lib OU extern/visual20??/lib dans gkit2light-master_CharAnim/bin (répertoire des exécutables), sinon vous aurez des erreurs à l’exécution des programmes
  • Lancez le script gkit2light-master_CharAnim/premake/premake-CharA.bat qui va créer les projets makefile/codeblocks/visual dans le répertoire gkitlight
  • Ouvrez le projet gkit2light-master_CharAnim/gkit2light.cbp ou gkit2light-master_CharAnim/build/gkit2light.sln


gKitLight la doc

Quelques explications sur le code

  • 'h' pour l'aide
  • 'a'=affiche/enlève les axes; 'g'=affiche/enlève la grille;
  • souris bouton gauche= rotation du monde
  • souris bouton droit et translation horizontale : pour zoomer
  • Votre code prendra place dans le module src/master_CharAnim/CharAnimViewer.h / .cpp


  • La class CharAnimViewer contient les fonctions init/draw qui s'occupent de l'affichage, elle dispose par héritage de fonction draw_sphere et draw_cylinder
  • Pour ajouter des fichiers au projet, regarder le master_CharAnim.lua dans la racine