Package javax.media.opengl

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


            gl.glVertex2f(p.x, p.y);
       
            p = t.getPoint(1);
        c = t.getColor(1);
        if(c == null) c = color;
        gl.glColor4f(c.x, c.y, c.z, c.w);
        texX = coords.left() + (coords.right() - coords.left()) / joglImage.texture.getImageWidth() * tc2.x;
        texY = coords.top() + (coords.bottom() - coords.top()) / joglImage.texture.getImageHeight() * tc2.y;
        gl.glTexCoord2f(texX, texY);
            gl.glVertex2f(p.x, p.y);
       
View Full Code Here


            gl.glVertex2f(p.x, p.y);
       
            p = t.getPoint(2);
        c = t.getColor(2);
        if(c == null) c = color;
        gl.glColor4f(c.x, c.y, c.z, c.w);
        texX = coords.left() + (coords.right() - coords.left()) / joglImage.texture.getImageWidth() * tc3.x;
        texY = coords.top() + (coords.bottom() - coords.top()) / joglImage.texture.getImageHeight() * tc3.y;
        gl.glTexCoord2f(texX, texY);
            gl.glVertex2f(p.x, p.y);
   
View Full Code Here

  public void drawSolidPolygon(Vec2[] vertices, int vertexCount, Color3f color) {
    GL2 gl = panel.getGL().getGL2();
    gl.glPushMatrix();
    transformViewport(gl, zero);
    gl.glBegin(GL2.GL_TRIANGLE_FAN);
    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();
View Full Code Here

      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];
      gl.glVertex2f(v.x, v.y);
    }
    gl.glEnd();
View Full Code Here

    float x = radius;
    float y = 0;
    float cx = center.x;
    float cy = center.y;
    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;
      x = c * x - s * y;
 
View Full Code Here

    float x = radius;
    float y = 0;
    float cx = center.x;
    float cy = center.y;
    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;
      x = c * x - s * y;
 
View Full Code Here

    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;
      x = c * x - s * y;
 
View Full Code Here

      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;
      x = c * x - s * y;
 
View Full Code Here

      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);
      }
      for (int j = 0; j < NUM_CIRCLE_POINTS; j++) {
View Full Code Here

      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);
      }
      for (int j = 0; j < NUM_CIRCLE_POINTS; j++) {
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.