Package javax.media.opengl

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


        gl.glBegin(GL2.GL_QUADS);
        gl.glVertex3f(-0.5f, 0.5f, 0.0f);
        gl.glVertex3f(0.5f, 0.5f, 0.0f);
        gl.glVertex3f(0.5f, -0.5f, 0.0f);
        gl.glVertex3f(-0.5f, -0.5f, 0.0f);
        gl.glEnd();

        gl.glFlush();
    }

View Full Code Here


    // end last primitive if necessary
    if(drawable.getLastPrimitive() != null) {
      // LINES AND POINTS NOT CURRENTLY OPTIMIZED
      if(primitive != drawable.getLastPrimitive() ||
          primitive == Primitive.LINE || primitive == Primitive.POINT || primitive == Primitive.TEXTURED_TRIANGLE) {
        gl.glEnd();
        ended = true;
      }
    }
    // handle image binding and target enabling/disabling
    if(image != drawable.getLastImage()) {
View Full Code Here

    gl.glTranslatef(-1.5f, 0.0f, -6.0f);
    gl.glBegin(GL2.GL_TRIANGLES);
    gl.glVertex3f( 0.0f1.0f, 0.0f);
    gl.glVertex3f(-1.0f, -1.0f, 0.0f);
    gl.glVertex3f( 1.0f, -1.0f, 0.0f);
    gl.glEnd();
    gl.glTranslatef(3.0f, 0.0f, 0.0f);
    gl.glBegin(GL2.GL_QUADS);
    gl.glVertex3f(-1.0f1.0f, 0.0f);
    gl.glVertex3f( 1.0f1.0f, 0.0f);
    gl.glVertex3f( 1.0f, -1.0f, 0.0f);
View Full Code Here

    gl.glBegin(GL2.GL_QUADS);
    gl.glVertex3f(-1.0f1.0f, 0.0f);
    gl.glVertex3f( 1.0f1.0f, 0.0f);
    gl.glVertex3f( 1.0f, -1.0f, 0.0f);
    gl.glVertex3f(-1.0f, -1.0f, 0.0f);
    gl.glEnd();
            }
           
            @Override
            public void postRender() {
                System.out.println("Canvas3D.postRender()");
View Full Code Here

    gl.glColor4f(color.x, color.y, color.z, .4f);
    for (int i = 0; i < vertexCount; i++) {
      Vec2 v = vertices[i];
      gl.glVertex2f(v.x, v.y);
    }
    gl.glEnd();

    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];
View Full Code Here

    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();
  }

  @Override
  public void drawCircle(Vec2 center, float radius, Color3f color) {
View Full Code Here

      // apply the rotation matrix
      float temp = x;
      x = c * x - s * y;
      y = s * temp + c * y;
    }
    gl.glEnd();
    gl.glPopMatrix();
  }

  @Override
  public void drawCircle(Vec2 center, float radius, Vec2 axis, Color3f color) {
View Full Code Here

      // apply the rotation matrix
      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

    }
    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();
  }

  @Override
  public void drawSolidCircle(Vec2 center, float radius, Vec2 axis, Color3f color) {
View Full Code Here

      // apply the rotation matrix
      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
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.