JOGL ColorsIn JOGL, a figure can be filled out with different type of colors. Coloring just enhances the look and feel of figure. To specify the type of color, JOGL uses glColor3f() method of GL2 interface. This method follows RGB (Red, Green, Blue) color model. In this model, each color is represented with a value between 0 to 1 where 0 means none of that color and 1 means maximum of that color. Note - It is required to pass the value of all three colors as a parameter of glColor3f() method.JOGL Color Code ListFollowing is the list of codes for some frequently used colors :
JOGL single coloring ExampleThis is a simple example where a triangle is filled out with one (green) color only. JColor.java Output: JOGL mixed Coloring ExampleIn this example, a triangle is filled out with three different colors. JMColor.java Output: Next TopicJOGL Rotation |