Examples of glBegin()


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

      float temp = x;
      x = c * x - s * y;
      y = s * temp + c * y;
    }
    gl.glEnd();
    gl.glBegin(GL2.GL_LINES);
    gl.glVertex3f(cx, cy, 0);
    gl.glVertex3f(cx + axis.x * radius, cy + axis.y * radius, 0);
    gl.glEnd();
    gl.glPopMatrix();
  }
View Full Code Here

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

    float s = MathUtils.sin(theta);
    float x = radius;
    float y = 0;
    float cx = center.x;
    float cy = center.y;
    gl.glBegin(GL2.GL_TRIANGLE_FAN);
    gl.glColor4f(color.x, color.y, color.z, .4f);
    for (int i = 0; i < NUM_CIRCLE_POINTS; i++) {
      gl.glVertex3f(x + cx, y + cy, 0);
      // apply the rotation matrix
      float temp = x;
View Full Code Here

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

      float temp = x;
      x = c * x - s * y;
      y = s * temp + c * y;
    }
    gl.glEnd();
    gl.glBegin(GL2.GL_LINE_LOOP);
    gl.glColor4f(color.x, color.y, color.z, 1);
    for (int i = 0; i < NUM_CIRCLE_POINTS; i++) {
      gl.glVertex3f(x + cx, y + cy, 0);
      // apply the rotation matrix
      float temp = x;
View Full Code Here

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

      float temp = x;
      x = c * x - s * y;
      y = s * temp + c * y;
    }
    gl.glEnd();
    gl.glBegin(GL2.GL_LINES);
    gl.glVertex3f(cx, cy, 0);
    gl.glVertex3f(cx + axis.x * radius, cy + axis.y * radius, 0);
    gl.glEnd();
    gl.glPopMatrix();
  }
View Full Code Here

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

  @Override
  public void drawSegment(Vec2 p1, Vec2 p2, Color3f color) {
    GL2 gl = panel.getGL().getGL2();
    gl.glPushMatrix();
    transformViewport(gl, zero);
    gl.glBegin(GL2.GL_LINES);
    gl.glColor3f(color.x, color.y, color.z);
    gl.glVertex3f(p1.x, p1.y, 0);
    gl.glVertex3f(p2.x, p2.y, 0);
    gl.glEnd();
    gl.glPopMatrix();
View Full Code Here

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

    for (int i = 0; i < count; i++) {
      Vec2 center = centers[i];
      float cx = center.x;
      float cy = center.y;
      gl.glBegin(GL2.GL_TRIANGLE_FAN);
      if (colors == null) {
        gl.glColor4f(1, 1, 1, .4f);
      } else {
        ParticleColor color = colors[i];
        gl.glColor4b(color.r, color.g, color.b, color.a);
View Full Code Here

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

    for (int i = 0; i < count; i++) {
      Vec2 center = centers[i];
      float cx = center.x;
      float cy = center.y;
      gl.glBegin(GL2.GL_LINE_LOOP);
      if (colors == null) {
        gl.glColor4f(1, 1, 1, 1);
      } else {
        ParticleColor color = colors[i];
        gl.glColor4b(color.r, color.g, color.b, (byte) 127);
View Full Code Here

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

    GL2 gl = panel.getGL().getGL2();
    getWorldToScreenToOut(xf.p, temp);
    temp2.setZero();
    float k_axisScale = 0.4f;

    gl.glBegin(GL2.GL_LINES);
    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);
View Full Code Here

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

  @Override
  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

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

  @Override
  public void drawPolygon(Vec2[] vertices, int vertexCount, Color3f color) {
    GL2 gl = panel.getGL().getGL2();
    gl.glPushMatrix();
    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);
    }
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.