Petite couleur pour différencier quand superposées

C'est des niveaux de gris :°  😎
This commit is contained in:
Theo 2024-09-09 13:34:11 +02:00
parent a8f5d7965a
commit d26b9b1f96

20
main.c
View File

@ -93,7 +93,13 @@ void ligne(int index, float hgx, float hgy, float bdx, float bdy)
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
glOrtho(-1.0,1.0,-1.0,1.0,-1.0,1.0); glOrtho(-1.0,1.0,-1.0,1.0,-1.0,1.0);
glColor3f(1.0,1.0,1.0);
float color = 1.0;
if(mode_affichage == SUPERPOSER)
color = map(0, nc, index, 0.5, 1.0);
glColor3f(color, color, color);
glBegin(GL_LINE_STRIP); glBegin(GL_LINE_STRIP);
unsigned int size = (unsigned int)courbe[index][0]; unsigned int size = (unsigned int)courbe[index][0];
@ -158,7 +164,13 @@ void histo(int index, float hgx, float hgy, float bdx, float bdy)
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
glOrtho(-1.0,1.0,-1.0,1.0,-1.0,1.0); glOrtho(-1.0,1.0,-1.0,1.0,-1.0,1.0);
glColor3f(1.0,1.0,1.0);
float color = 1.0;
if(mode_affichage == SUPERPOSER)
color = map(0, nc, index, 0.5, 1.0);
glColor3f(color, color, color);
//glBegin(GL_POLYGON); //glBegin(GL_POLYGON);
unsigned int size = (unsigned int)courbe[index][0]; unsigned int size = (unsigned int)courbe[index][0];
@ -431,8 +443,8 @@ int main(int argc, char* argv[])
printCourbeTerminal(); printCourbeTerminal();
type_dessin = LIGNE_AXES; type_dessin = HISTOGRAMME;
mode_affichage = VERTICAL; mode_affichage = HORIZONTAL;
int window = initWindow(argc, argv, afficher); int window = initWindow(argc, argv, afficher);
glutMainLoop(); glutMainLoop();