Examples of glColor3f()


Examples of javax.media.opengl.GL2.glColor3f()

        final GL2 gl = drawable.getGL().getGL2();
       
        gl.glBegin(GL_LINES);
       
        // X-Axis
        gl.glColor3f( 1, 0, 0 );
        gl.glVertex3f( 0, 0, 0 );
        gl.glVertex3f( 50, 0, 0 );

        // Y-Axis
        gl.glColor3f( 0, 1, 0 );
View Full Code Here

Examples of javax.media.opengl.GL2.glColor3f()

        gl.glColor3f( 1, 0, 0 );
        gl.glVertex3f( 0, 0, 0 );
        gl.glVertex3f( 50, 0, 0 );

        // Y-Axis
        gl.glColor3f( 0, 1, 0 );
        gl.glVertex3f( 0, 0, 0 );
        gl.glVertex3f( 0, 50, 0 );
       
        // Z-Axis
        gl.glColor3f( 0, 0, 1 );
View Full Code Here

Examples of javax.media.opengl.GL2.glColor3f()

        gl.glColor3f( 0, 1, 0 );
        gl.glVertex3f( 0, 0, 0 );
        gl.glVertex3f( 0, 50, 0 );
       
        // Z-Axis
        gl.glColor3f( 0, 0, 1 );
        gl.glVertex3f( 0, 0, 0 );
        gl.glVertex3f( 0, 0, 50 );
       
        gl.glEnd();
       
View Full Code Here

Examples of javax.media.opengl.GL2.glColor3f()

        // push the current color
        gl.glPushAttrib(GL2.GL_CURRENT_BIT);

        // use the current polygon's color
        gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue());

        // if only 1 vertex, draw a point
        if (polygon.vertices().size() == 1)
            gl.glBegin(GL.GL_POINTS);
View Full Code Here

Examples of javax.media.opengl.GL2.glColor3f()

        // push the current color
        gl.glPushAttrib(GL2.GL_CURRENT_BIT);

        // use the current polygon's color
        gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue());

        // if only 1 vertex, draw a point
        if (polygon.vertices().size() == 1)
            gl.glBegin(GL.GL_POINTS);
View Full Code Here

Examples of javax.media.opengl.GL2.glColor3f()

            return;
        final GL2 gl = (GL2) drawable.getGL();


        //Color color = circle.getColor();
        gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue());

        //Making circle in 50 small triangles
        double increment = 2 * Math.PI / 50;

        float cx = circle.getCenterPoint().x;
View Full Code Here

Examples of javax.media.opengl.GL2.glColor3f()

      gl.glBegin(GL.GL_POINTS);  
      for (int y = 0; y < this.canvas.getHeight(); y++) {
        for (int x = 0; x < this.canvas.getWidth(); x++) {
          if (this.shapes[selectedShapeIndex].isInside(x, y))
            // the inside is red
            gl.glColor3f(1.0f, 0.0f, 0.0f);
          else
            // the outside is gray
            gl.glColor3f(0.0f, 0.0f, 0.0f);
          gl.glVertex2f(x, y);
        }
View Full Code Here

Examples of javax.media.opengl.GL2.glColor3f()

          if (this.shapes[selectedShapeIndex].isInside(x, y))
            // the inside is red
            gl.glColor3f(1.0f, 0.0f, 0.0f);
          else
            // the outside is gray
            gl.glColor3f(0.0f, 0.0f, 0.0f);
          gl.glVertex2f(x, y);
        }
      }
      gl.glEnd();
      // pop the current color
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.