PDA

View Full Version : Draw a HSV Model in OpenGL



QuesterDesura
05-09-2014, 12:16 AM
Hello,

I tried to create something similar to the HSV Color Model, but I failed and I hope you can help me with that. I am using GLUT and math.h.
Currently I have this:

KreisList = glGenLists(1);
glNewList(KreisList, GL_COMPILE);

glBegin(GL_TRIANGLE_FAN);
glColor3f(1, 1, 1);
glVertex2f(0, 0);

for (int i = 0; i < 360; i++) {
if (i > 170 && i < 190) {
glColor3f(0, 1, 1);
glVertex2f(cos(i * 2 * PI / 360), sin(i * 2 * PI / 360));
glColor3f(1, 1, 1);
}
else if (i > 189 && i < 270) {
glColor3f(0, 0, 1);
glVertex2f(cos(i * 2 * PI / 360), sin(i * 2 * PI / 360));
glColor3f(1, 1, 1);


}
else {
glColor3f(1, 0, 0);
glVertex2f(cos(i * 2 * PI / 360), sin(i * 2 * PI / 360));
glColor3f(1, 1, 1);

}


}

glColor3f(1, 0,0);
glVertex2f(cos(1 * 2 * PI / 360), sin(1 * 2 * PI / 360));

glEnd();
glEndList();

}

And yes I am using Old OpenGL.

QuesterDesura

carsten neumann
05-09-2014, 02:55 AM
You are not saying what is not working and what exactly you had expected to happen, please see Forum Posting Guidelines for suggestions how to ask questions that are likely to get helpful answers, thanks.