Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Draw a HSV Model in OpenGL

  1. #1
    Newbie Newbie
    Join Date
    May 2014
    Posts
    1

    Draw a HSV Model in OpenGL

    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:
    Code :
    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

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    785
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •