예제 #1
0
  private void renderBlast(GL2 gl) {
    GLU glu = new GLU();

    Shader shader = Shader.get("dissolve");
    if (shader != null) {
      shader.enable(gl);

      shader.setSampler(gl, "cloudSampler", 0);
      shader.setUniform(gl, "dissolveFactor", 1.0f - ((float) blastDuration / 60.0f));
    }

    gl.glEnable(GL2.GL_TEXTURE_2D);

    GLUquadric sphere = glu.gluNewQuadric();

    glu.gluQuadricDrawStyle(sphere, GLU.GLU_FILL);
    glu.gluQuadricTexture(sphere, true);

    gl.glPushMatrix();
    {
      noiseSampler.bind(gl);
      noiseSampler.setTexParameterf(gl, GL2.GL_TEXTURE_MAX_ANISOTROPY_EXT, 16);

      gl.glTranslatef(bound.c.x, bound.c.y, bound.c.z);

      glu.gluSphere(sphere, blastRadius, 24, 24);
    }
    gl.glPopMatrix();
  }
예제 #2
0
  /** Draws a canonical circular particle. */
  private static void drawParticle(GL gl, Point3d p, double r) {
    double radius = r;

    double vectorY1 = p.y;
    double vectorX1 = p.x;
    double vectorZ1 = p.z;

    GLU glu = new GLU();
    GLUquadric quadratic = glu.gluNewQuadric();
    glu.gluQuadricNormals(quadratic, GLU.GLU_SMOOTH);
    glu.gluQuadricTexture(quadratic, true);

    gl.glPushMatrix();
    gl.glTranslated(p.x, p.y, p.z);
    glu.gluSphere(quadratic, radius, 12, 12);
    gl.glPopMatrix();
  }
예제 #3
0
 @Override
 public void display(GLAutoDrawable dr) {
   GL2 gl = dr.getGL().getGL2();
   // Очиска экрана
   gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
   // Загрузка единичной матрицы
   gl.glLoadIdentity();
   // Определение точки и направления взгляда
   glu.gluLookAt(0f, 0f, 10f, 0f, 0f, -100f, 0f, 1f, 0f);
   // Загрузка текстуры в графическую память
   this.texture.bind(gl);
   GLUquadric ground = glu.gluNewQuadric();
   // enabling texturing on the quadric
   glu.gluQuadricTexture(ground, true);
   glu.gluSphere(ground, 1, 64, 64);
   glu.gluDeleteQuadric(ground);
 }
예제 #4
0
 public BaconTable(GLU glu) {
   quadric = glu.gluNewQuadric();
   glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL); // GLU_POINT, GLU_LINE, GLU_FILL, GLU_SILHOUETTE
   glu.gluQuadricNormals(quadric, GLU.GLU_NONE); // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
   glu.gluQuadricTexture(quadric, true); // false, or true to generate texture coordinates
 }