Package javax.media.opengl

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


        //Defining radius of circle equal to 70 pixels
        double radius = circle.getRadius();

        //Starting loop for drawing triangles

        gl.glBegin(GL2.GL_POLYGON);
        for (double angle = 0; angle < 2 * Math.PI; angle += increment)
        {
            //One vertex of each triangle is at center of circle
            //gl.glVertex2d(cx, cy);
            //Other two vertices form the periphery of the circle
View Full Code Here


    // check if we need to highlight pixels which are inside the polygon
    if (this.insideOutsideTest) {
      // push the current color
      gl.glPushAttrib(GL2.GL_CURRENT_BIT);
      gl.glPointSize(3);
      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);
View Full Code Here

        texture.enable(gl);
        texture.bind(gl);

        // ----- Your OpenGL rendering code here ( Render a white triangle for testing ) -----
        gl.glTranslatef(0.0f, 0.0f, -6.0f); // translate into the screen
        gl.glBegin(GL_QUADS); // draw using quads
            gl.glTexCoord2f(textureLeft, textureBottom);
            gl.glVertex3f(0.0f, 0.0f, 0.0f);

            gl.glTexCoord2f(textureRight, textureTop);
            gl.glVertex3f(1.0f, 0.0f, 0.0f);
View Full Code Here

        texture.enable(gl);
        texture.bind(gl);

        // ----- Your OpenGL rendering code here ( Render a white triangle for testing ) -----
        gl.glTranslatef(0.0f, 0.0f, -6.0f); // translate into the screen
        gl.glBegin(GL_QUADS); // draw using quads
            gl.glTexCoord2f(textureLeft, textureBottom);
            gl.glVertex3f(0.0f, 0.0f, 0.0f);

            gl.glTexCoord2f(textureRight, textureTop);
            gl.glVertex3f(1.0f, 0.0f, 0.0f);
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.