Package javax.media.opengl

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


    gl.glBegin(GL2.GL_LINE_LOOP);
    gl.glColor4f(color.x, color.y, color.z, 1f);
    for (int i = 0; i < vertexCount; i++) {
      Vec2 v = vertices[i];
      gl.glVertex2f(v.x, v.y);
    }
    gl.glEnd();
    gl.glPopMatrix();
  }
View Full Code Here


    gl.glColor3f(1, 0, 0);

    temp2.x = xf.p.x + k_axisScale * xf.q.c;
    temp2.y = xf.p.y + k_axisScale * xf.q.s;
    getWorldToScreenToOut(temp2, temp2);
    gl.glVertex2f(temp.x, temp.y);
    gl.glVertex2f(temp2.x, temp2.y);

    gl.glColor3f(0, 1, 0);
    temp2.x = xf.p.x + -k_axisScale * xf.q.s;
    temp2.y = xf.p.y + k_axisScale * xf.q.c;
 
View Full Code Here

    temp2.x = xf.p.x + k_axisScale * xf.q.c;
    temp2.y = xf.p.y + k_axisScale * xf.q.s;
    getWorldToScreenToOut(temp2, temp2);
    gl.glVertex2f(temp.x, temp.y);
    gl.glVertex2f(temp2.x, temp2.y);

    gl.glColor3f(0, 1, 0);
    temp2.x = xf.p.x + -k_axisScale * xf.q.s;
    temp2.y = xf.p.y + k_axisScale * xf.q.c;
    getWorldToScreenToOut(temp2, temp2);
View Full Code Here

    gl.glColor3f(0, 1, 0);
    temp2.x = xf.p.x + -k_axisScale * xf.q.s;
    temp2.y = xf.p.y + k_axisScale * xf.q.c;
    getWorldToScreenToOut(temp2, temp2);
    gl.glVertex2f(temp.x, temp.y);
    gl.glVertex2f(temp2.x, temp2.y);
    gl.glEnd();
  }

  @Override
View Full Code Here

    gl.glColor3f(0, 1, 0);
    temp2.x = xf.p.x + -k_axisScale * xf.q.s;
    temp2.y = xf.p.y + k_axisScale * xf.q.c;
    getWorldToScreenToOut(temp2, temp2);
    gl.glVertex2f(temp.x, temp.y);
    gl.glVertex2f(temp2.x, temp2.y);
    gl.glEnd();
  }

  @Override
  public void drawString(float x, float y, String s, Color3f color) {
View Full Code Here

  public void drawPoint(Vec2 argPoint, float argRadiusOnScreen, Color3f argColor) {
    Vec2 vec = getWorldToScreen(argPoint);
    GL2 gl = panel.getGL().getGL2();
    gl.glPointSize(argRadiusOnScreen);
    gl.glBegin(GL2.GL_POINTS);
    gl.glVertex2f(vec.x, vec.y);
    gl.glEnd();
  }

  private final Vec2 zero = new Vec2();
View Full Code Here

    transformViewport(gl, zero);
    gl.glBegin(GL2.GL_LINE_LOOP);
    gl.glColor4f(color.x, color.y, color.z, 1f);
    for (int i = 0; i < vertexCount; i++) {
      Vec2 v = vertices[i];
      gl.glVertex2f(v.x, v.y);
    }
    gl.glEnd();
    gl.glPopMatrix();
  }
View Full Code Here

        // otherwise draw a polygon
        else
            gl.glBegin(GL2.GL_TRIANGLE_FAN); /* For best performance here */

        for (final Point vertex : polygon.vertices())
            gl.glVertex2f(vertex.x, vertex.y);

        gl.glEnd();

        /* Now draw each indidual hole */
        for (ArrayList<Point> hole : polygon.holes())
View Full Code Here

            // otherwise draw a polygon
            else
                gl.glBegin(GL2.GL_TRIANGLE_FAN); /* For best performance here */

            for (final Point vertex : hole)
                gl.glVertex2f(vertex.x, vertex.y);

            gl.glEnd();
        }

        /* Finally draw all of the circular holes */
 
View Full Code Here

        // otherwise draw a polygon
        else
            gl.glBegin(GL2.GL_POLYGON);

        for (final Point vertex : polygon.vertices())
            gl.glVertex2f(vertex.x, vertex.y);

        gl.glEnd();

        /* Now draw each indidual hole */
        for (ArrayList<Point> hole : polygon.holes())
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.