Exemple #1
0
  private void renderPin(GL gl, Coordinates position, float[] color, float size) {
    float height = heightmap.getHeight(projection.getGeoCoordinates(position));
    gl.glPushMatrix();
    double[] model = new double[16];
    gl.glGetDoublev(GL_MODELVIEW_MATRIX, model, 0);
    double zoomH =
        0.1 / Math.sqrt((model[0] * model[0]) + (model[1] * model[1]) + (model[2] * model[2]));
    double zoomZ =
        0.1 / Math.sqrt((model[8] * model[8]) + (model[9] * model[9]) + (model[10] * model[10]));
    gl.glTranslatef(position.getLongitude(), position.getLatitude(), height);
    gl.glScaled(zoomH * size, zoomH * size, zoomZ * size);
    gl.glDisable(GL_TEXTURE_2D);

    gl.glRotatef(20, 0.3f, 1, 0);

    GLU glu = new GLU();
    GLUquadric quadric = glu.gluNewQuadric();
    // glu.gluQuadricNormals(quadric, GLU.GLU_FLAT);
    gl.glColor3f(0.5f, 0.5f, 0.5f);
    gl.glEnable(GL_LIGHTING);
    glu.gluCylinder(quadric, 0.03, 0.03, 0.6f, 5, 1);
    gl.glTranslatef(0, 0, 0.6f);

    gl.glColor3f(color[0], color[1], color[2]);
    gl.glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
    glu.gluSphere(quadric, 0.12, 8, 8);
    // glu.gluCylinder(quadric, 0.2, 0.1, 0.5, 8, 1);
    gl.glDisable(GL_LIGHTING);
    glu.gluDeleteQuadric(quadric);
    gl.glPopMatrix();
  }
Exemple #2
0
  private final void applyCameraAdjustment(final GL gl) {
    this.camera.rotateAroundTarget(-this.thetaZ, -this.thetaX);

    gl.glTranslatef(0, 0, -this.camera.getDistanceFromTarget());

    gl.glRotatef(-this.camera.getVerticalAngle(), 1, 0, 0);
    gl.glRotatef(-this.camera.getHorizontalAngle(), 0, 0, 1);

    final float[] cameraTarget = this.camera.getTarget();
    gl.glTranslatef(-cameraTarget[0], -cameraTarget[1], -cameraTarget[2]);
  }
Exemple #3
0
  public void desenhar(GL gl, GLUT glut) {
    gl.glShadeModel(GL.GL_FLAT);
    gl.glNormal3f(0.0f, 0.0f, 1.0f);
    gl.glColor3f(1f, 1f, 1f);

    float corWhite[] = {1.0f, 1.0f, 1.0f, 1.0f};

    // base
    setTexture(Util.loadImage("texture/textureBrick.png"));
    getTexture().enable();
    getTexture().bind();
    gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, corWhite, 0);
    gl.glEnable(GL.GL_LIGHTING);
    gl.glPushMatrix();
    gl.glTranslatef(0f, -dif, 0f);
    gl.glScalef(getxEscala(), getyEscala(), getzEscala());
    glut.glutSolidCube(1f);
    gl.glPopMatrix();

    // esquerda
    setTexture(Util.loadImage("texture/tijolos/medio2.png"));
    getTexture().enable();
    getTexture().bind();
    gl.glPushMatrix();
    gl.glTranslatef(-(getxEscala() / 2), (getAltura() / 2) - dif, 0f);
    gl.glScalef(0.1f, getAltura(), getzEscala());
    glut.glutSolidCube(1f);
    gl.glPopMatrix();
    gl.glDisable(GL.GL_LIGHTING);

    // direita
    setTexture(Util.loadImage("texture/tijolos/medio2.png"));
    getTexture().enable();
    getTexture().bind();
    gl.glPushMatrix();
    gl.glTranslatef(getxEscala() / 2, (getAltura() / 2) - dif, 0f);
    gl.glScalef(0.1f, getAltura(), getzEscala());
    glut.glutSolidCube(1f);
    gl.glPopMatrix();
    gl.glDisable(GL.GL_LIGHTING);

    // fundo
    setTexture(Util.loadImage("texture/tijolos/fraco.png"));
    getTexture().enable();
    getTexture().bind();
    gl.glPushMatrix();
    gl.glTranslatef(0f, (getAltura() / 2) - dif, -(getzEscala() / 2));
    gl.glScalef(getxEscala(), getAltura(), 0.1f);
    glut.glutSolidCube(1f);
    gl.glPopMatrix();
    gl.glDisable(GL.GL_LIGHTING);
  }
Exemple #4
0
  public void display(GL gl, float time, int screenWidth, int screenHeight) {
    // TODO: most of this only needs to be done once per frame, not per button.
    if (!visible) {
      return;
    }
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glPushMatrix();
    if (flipx) {
      gl.glTranslatef(1.0f, 0.0f, 0.0f);
      gl.glScalef(-1.0f, 1.0f, 1.0f);
    }
    if (flipy) {
      gl.glTranslatef(0.0f, 1.0f, 0.0f);
      gl.glScalef(1.0f, -1.0f, 1.0f);
    }
    gl.glScalef(1.0f / screenWidth, 1.0f / screenHeight, 1.0f);
    if (isSelected() || (mDown && mOver)) {
      gl.glColor3f(0.6f, 0.6f, 0.8f);
    } else {
      gl.glColor3f(0.8f, 0.8f, 0.8f);
    }
    gl.glActiveTexture(GL.GL_TEXTURE0);
    marble.enable();
    marble.bind();
    gl.glMatrixMode(GL.GL_TEXTURE);
    gl.glPushMatrix();
    gl.glLoadIdentity();
    gl.glBegin(GL.GL_POLYGON);

    for (int n = 0; n < buttonShape.npoints; n++) {
      gl.glTexCoord2f(n / 2, (n + n / 2 + 1) % 2);
      gl.glVertex3f(buttonShape.xpoints[n], buttonShape.ypoints[n], -0.5f);
    }
    gl.glEnd();

    tex.enable();
    tex.bind();
    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
    gl.glBegin(GL.GL_POLYGON);

    for (int n = 0; n < buttonShape.npoints; n++) {
      gl.glTexCoord2f(n / 2, (n + n / 2 + 1) % 2);
      gl.glVertex3f(buttonShape.xpoints[n], buttonShape.ypoints[n], -1.0f);
    }
    gl.glEnd();
    gl.glPopMatrix();

    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glPopMatrix();
  }
Exemple #5
0
  /**
   * @param glRenderContext
   * @param prototype
   * @param buffer to be used for rendering.
   */
  public static synchronized void render(
      RenderContext glRenderContext, PrototypeReference prototype, DirectGeometryBuffer buffer) {
    if (prototype == null || prototype.getPrototypeID() == null) {
      return;
    }
    RenderablePrototype model = prototypes.get(prototype.getPrototypeID());

    if (model == null) {
      LOG.warn("No model found for prototype: " + prototype.getPrototypeID());
      return;
    }

    GL context = glRenderContext.getContext();

    context.glPushMatrix();

    float[] loc = prototype.getLocation();
    context.glTranslatef(loc[0], loc[1], loc[2]);
    context.glRotatef(prototype.getAngle(), 0, 0, 1);
    context.glScalef(prototype.getWidth(), prototype.getDepth(), prototype.getHeight());
    if (buffer == null) {
      model.render(null);
    } else {
      model.renderPrepared(glRenderContext, buffer);
    }
    context.glPopMatrix();
  }
Exemple #6
0
  /** OpenGL drawing function */
  @Override
  public void display(GLAutoDrawable auto_drawable) {
    // get the GL context
    final GL gl = auto_drawable.getGL();
    // clear the buffers
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    // load the identity matrix
    gl.glLoadIdentity();

    // translations so we can see drawing
    gl.glTranslatef(0, 0, -0.7f);

    if (LoadTexturePosted == true) {
      if (LoadGuessModelPosted == null) System.err.println("ERROR: LoadGuessModelPosted is null!");
      current_Texture =
          AnimalTexture.findAnimalTexture(Animal_Tex_Array, LoadGuessModelPosted.getAnimalName());
      LoadTexturePosted = false;
    }

    // if the current texture is null, load the question texture
    if (current_Texture == null) question_Texture.bind();
    else current_Texture.bind();

    // draw the cube
    gl.glPushMatrix();
    gl.glRotatef(yrotate, 0.0f, 1.0f, 0.0f);
    drawOpenCube(gl);
    gl.glPopMatrix();

    // increase rotation
    yrotate += 0.05;
  }
Exemple #7
0
  public void translateAccordingToCameraPosition(GL gl) {

    // gl.glTranslatef(-loc.x, -loc.y, -loc.z);
    gl.glRotatef(this.pitch, 1.0f, 0.0f, 0.0f);
    gl.glRotatef(this.heading, 0.0f, 1.0f, 0.0f);
    gl.glTranslatef(-loc.x, -loc.y, -loc.z);
  }
Exemple #8
0
  public void renderBox(GL gl) {
    gl.glDisable(GL_TEXTURE_2D);
    int c1 = Math.abs(this.hashCode()) % 256;
    int c2 = Math.abs(getImage().hashCode()) % 256;
    gl.glColor4f(c1 / 256f, c2 / 256f, ((c1 + c2) * 34) % 256 / 256f, 0.3f);
    gl.glPushMatrix();
    gl.glTranslatef(bounds.getLeft(), bounds.getTop(), minHeight);
    gl.glScalef(bounds.getWidth(), bounds.getHeight(), maxHeight - minHeight);
    gl.glBegin(GL_QUADS);
    gl.glVertex3f(0, 0, 0);
    gl.glVertex3f(0, 1, 0);
    gl.glVertex3f(1, 1, 0);
    gl.glVertex3f(1, 0, 0);

    gl.glVertex3f(0, 0, 1);
    gl.glVertex3f(0, 1, 1);
    gl.glVertex3f(1, 1, 1);
    gl.glVertex3f(1, 0, 1);
    gl.glEnd();
    gl.glColor4f(1, 1, 0, 0.2f);
    gl.glBegin(GL_QUAD_STRIP);
    gl.glVertex3f(0, 0, 0);
    gl.glVertex3f(0, 0, 1);
    gl.glVertex3f(0, 1, 0);
    gl.glVertex3f(0, 1, 1);
    gl.glVertex3f(1, 1, 0);
    gl.glVertex3f(1, 1, 1);
    gl.glVertex3f(1, 0, 0);
    gl.glVertex3f(1, 0, 1);
    gl.glVertex3f(0, 0, 0);
    gl.glVertex3f(0, 0, 1);
    gl.glEnd();
    gl.glPopMatrix();
  }
Exemple #9
0
 void glSpiral(final GL gl, Node aref, HashSet<Node> cluster) {
   int i = 0;
   float r = 0;
   float matrix[] = new float[16];
   for (Node bref : cluster) {
     if (bref != null) {
       i++;
       r = spiral_rad(aref, i);
       gl.glPushMatrix();
       gl.glLoadIdentity();
       gl.glTranslatef(aref.pos.x, aref.pos.y, aref.pos.z);
       gl.glRotatef(spiral_angle(aref, i), 0, 0, 1);
       gl.glTranslatef(-r, 0, 0);
       gl.glGetFloatv(GL.GL_MODELVIEW_MATRIX, matrix, 0);
       bref.pos.setXYZ(matrix[12], matrix[13], matrix[14]);
       gl.glPopMatrix();
     }
   }
 }
 public void reshape(GLAutoDrawable gLDrawable, int x, int y, int width, int height) {
   GL gl = gLDrawable.getGL();
   float h = (float) width / (float) height;
   gl.glMatrixMode(GL.GL_PROJECTION);
   gl.glLoadIdentity();
   gl.glFrustum(-h, h, -1, 1, 1, 600);
   gl.glMatrixMode(GL.GL_MODELVIEW);
   gl.glLoadIdentity();
   gl.glTranslatef(0.0f, 0.0f, -6f);
 }
  public void draw() {

    background(0);
    rotate++;
    gl.glColor4f(1, 1, 1, 0.7f);
    gl.glTranslatef(0, 0, -200);
    gl.glRotatef(rotate, 0, 1, 0);
    gl.glRotatef(10, 1, 0, 0);

    t.draw();
  }
Exemple #12
0
 private void clusterCircle(final GL gl, float xRot, float yRot, Node aref) {
   aref.spiralcluster = false;
   int jcount = 0;
   float matrix[] = new float[16];
   float rad = aref.cluster.size();
   float clusterDist = calcClusterDistance(aref);
   for (Node bref : aref.cluster) {
     if (bref != null) {
       gl.glPushMatrix();
       gl.glLoadIdentity();
       gl.glTranslatef(aref.pos.x, aref.pos.y, aref.pos.z);
       //				gl.glRotatef(xRot, 0, 1, 0);
       //				gl.glRotatef(yRot, 1, 0, 0);
       gl.glRotatef(90 + 360 * jcount / rad, 0, 0, 1);
       gl.glTranslatef(-clusterDist, 0, 0);
       gl.glGetFloatv(GL.GL_MODELVIEW_MATRIX, matrix, 0);
       bref.pos.setXYZ(matrix[12], matrix[13], matrix[14]);
       gl.glPopMatrix();
       jcount++;
     }
   }
 }
  public void render(GLOContext ctx) {
    GUIContext guictx = (GUIContext) ctx;
    GL gl = ctx.getGL();

    ModelRenderer mrend =
        guictx.rendcache.getModelRenderer(xpointermodel, ModelRenderer.NO_NORMALS);

    gl.glPushMatrix(); // #1
    gl.glPushAttrib(GL.GL_ENABLE_BIT | GL.GL_POLYGON_BIT);
    gl.glEnable(GL.GL_CULL_FACE);

    setShader("xpointer");
    Point org = origin;
    float w2 = getWidth() * 0.5f;
    float h2 = getHeight() * 0.5f;
    float cenx = org.x + w2;
    float ceny = org.y + h2;

    gl.glTranslatef(cenx, ceny, 0);
    gl.glScalef(w2, h2, 1); // must convert right-hand to left-hand coords

    // draw the x value
    gl.glPushMatrix();
    float xval = getXValue();
    xval = Math.max(-maxrot, Math.min(maxrot, xval * maxrot));
    gl.glRotatef(90, 0, 0, 1);
    gl.glRotatef(xval, -1, 0, 0);
    mrend.render();
    gl.glPopMatrix();

    // draw the y value
    float yval = getYValue();
    yval = Math.max(-maxrot, Math.min(maxrot, yval * maxrot));
    gl.glRotatef(yval, -1, 0, 0);
    mrend.render();

    gl.glPopAttrib();
    gl.glPopMatrix(); // #1
  }
Exemple #14
0
 static final void method547(
     int i, int i_86_, int i_87_, int i_88_, boolean[][] bools, int[][] is) {
   GL gl = Class97.aGL1536;
   Class97.method1546(1);
   Class97.method1553(1);
   Class97.method1538();
   Class97.method1518(false);
   Class83_Sub14.method943(116, 0, 0);
   gl.glDepthMask(false);
   for (int i_89_ = 0; i_89_ < anInt941; i_89_++) {
     for (int i_90_ = 0; i_90_ < anInt944; i_90_++) {
       while_57_:
       for (int i_91_ = i_89_ * 8; i_91_ < i_89_ * 8 + 8; i_91_++) {
         if (i_91_ - i >= -i_87_ && i_91_ - i <= i_87_) {
           for (int i_92_ = i_90_ * 8; i_92_ < i_90_ * 8 + 8; i_92_++) {
             if (i_92_ - i_86_ >= -i_87_
                 && i_92_ - i_86_ <= i_87_
                 && (bools[i_91_ - i + i_87_][i_92_ - i_86_ + i_87_])) {
               Class38 class38 = aClass38ArrayArray940[i_89_][i_90_];
               if (((Class38) class38).aBoolean718) {
                 class38.method351(aClass17_Sub1_942, i_89_, i_90_);
                 ((Class38) class38).aBoolean718 = false;
               }
               gl.glPushMatrix();
               gl.glTranslatef((float) (i_89_ * 1024), 0.0F, (float) (i_90_ * 1024));
               class38.method354();
               gl.glPopMatrix();
               break while_57_;
             }
           }
         }
       }
     }
   }
   gl.glEnableClientState(32886);
   gl.glDepthMask(true);
   Class97.method1552();
 }
Exemple #15
0
  public void draw() {
    if (!isTiling) {
      psys.update(srcImage.getPixels(), dstImage.getPixels());
    }

    tiler.pre();

    background(0);

    srcImage.draw();
    //		dstImage.draw();

    // lights.
    if (isLightingEnabled) {
      gl.glEnable(GL.GL_LIGHTING);
      gl.glEnable(GL.GL_LIGHT1);
    } else {
      gl.glDisable(GL.GL_LIGHTING);
      gl.glDisable(GL.GL_LIGHT1);
    }

    // START DRAW.
    pgl.beginGL();
    gl.glPushMatrix();
    gl.glTranslatef(sceneCenterX, sceneCenterY, sceneCenterZ);
    drawSomething();
    gl.glPopMatrix();
    pgl.endGL();

    tiler.post();
    if (!tiler.checkStatus() && isTiling) {
      isTiling = false;
    }

    if (isRecording) save("export/image" + frameCount + ".png");
  }
Exemple #16
0
 public void camLoc(GL gl) {
   gl.glTranslatef(this.loc.x, this.loc.y, this.loc.z);
 }
Exemple #17
0
  /** Here we actually draw the scene. */
  public void display(GLAutoDrawable drawable) {
    super.display(drawable);

    System.out.println("GLScene - display");
    GL gl = drawable.getGL();

    try {
      // Update velocities and positions of all text
      float deltaT = 0.1f;
      Point2f tmp = new Point2f();

      for (Iterator<TextInfo> iter = textInfo.iterator(); iter.hasNext(); ) {
        TextInfo info = (TextInfo) iter.next();

        // Randomize things a little bit at run time
        if (random.nextInt(1000) == 0) {
          info.angularVelocity = INIT_ANG_VEL_MAG * (randomAngle() - 180);
          info.velocity = randomVelocity(INIT_VEL_MAG, INIT_VEL_MAG);
        }

        // Now update angles and positions
        info.angle += info.angularVelocity * deltaT;
        tmp.set(info.velocity);
        tmp.scale(deltaT);
        info.position.add(tmp);

        // Update color
        info.curTime += deltaT;
        if (info.curTime > 2 * Math.PI) {
          info.curTime -= 2 * Math.PI;
        }
        int rgb =
            Color.HSBtoRGB(info.h, (float) (0.5 * (1 + Math.sin(info.curTime)) * info.s), info.v);
        info.r = ((rgb >> 16) & 0xFF) / 255.0f;
        info.g = ((rgb >> 8) & 0xFF) / 255.0f;
        info.b = (rgb & 0xFF) / 255.0f;

        // Wrap angles and positions
        if (info.angle < 0) {
          info.angle += 360;
        } else if (info.angle > 360) {
          info.angle -= 360;
        }
        // Use maxTextWidth to avoid popping in/out at edges
        // Would be better to do oriented bounding rectangle computation
        if (info.position.x < -maxTextWidth) {
          info.position.x = info.position.x + glComposite.getCanvas().getWidth() + 2 * maxTextWidth;
        } else if (info.position.x > glComposite.getCanvas().getWidth() + maxTextWidth) {
          info.position.x = info.position.x - glComposite.getCanvas().getWidth() - 2 * maxTextWidth;
        }
        if (info.position.y < -maxTextWidth) {
          info.position.y =
              info.position.y + glComposite.getCanvas().getHeight() + 2 * maxTextWidth;
        } else if (info.position.y > glComposite.getCanvas().getHeight() + maxTextWidth) {
          info.position.y =
              info.position.y - glComposite.getCanvas().getHeight() - 2 * maxTextWidth;
        }
      }

      gl.glClear(GL.GL_COLOR_BUFFER_BIT);
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glLoadIdentity();
      glComposite
          .getGLU()
          .gluOrtho2D(
              0, glComposite.getCanvas().getWidth(), 0, glComposite.getCanvas().getHeight());
      gl.glMatrixMode(GL.GL_MODELVIEW);
      gl.glLoadIdentity();

      // Draw the background texture
      backgroundTexture.enable();
      backgroundTexture.bind();
      TextureCoords coords = backgroundTexture.getImageTexCoords();
      int w = glComposite.getCanvas().getWidth();
      int h = glComposite.getCanvas().getHeight();
      float fw = w / 100.0f;
      float fh = h / 100.0f;
      gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
      gl.glBegin(GL.GL_QUADS);
      gl.glTexCoord2f(fw * coords.left(), fh * coords.bottom());
      gl.glVertex3f(0, 0, 0);
      gl.glTexCoord2f(fw * coords.right(), fh * coords.bottom());
      gl.glVertex3f(w, 0, 0);
      gl.glTexCoord2f(fw * coords.right(), fh * coords.top());
      gl.glVertex3f(w, h, 0);
      gl.glTexCoord2f(fw * coords.left(), fh * coords.top());
      gl.glVertex3f(0, h, 0);
      gl.glEnd();
      backgroundTexture.disable();

      // Render all text
      renderer.beginRendering(w, h);

      // Note we're doing some slightly fancy stuff to position the text.
      // We tell the text renderer to render the text at the origin, and
      // manipulate the modelview matrix to put the text where we want.

      gl.glMatrixMode(GL.GL_MODELVIEW);

      // First render drop shadows
      renderer.setColor(0, 0, 0, 0.5f);
      for (Iterator<TextInfo> iter = textInfo.iterator(); iter.hasNext(); ) {
        TextInfo info = (TextInfo) iter.next();
        gl.glLoadIdentity();
        gl.glTranslatef(
            info.position.x + dropShadowDistance, info.position.y - dropShadowDistance, 0);
        gl.glRotatef(info.angle, 0, 0, 1);
        renderer.draw(info.text, 0, 0);
        renderer.flush();
      }

      // Now render the actual text
      for (Iterator<TextInfo> iter = textInfo.iterator(); iter.hasNext(); ) {
        TextInfo info = (TextInfo) iter.next();
        gl.glLoadIdentity();
        gl.glTranslatef(info.position.x, info.position.y, 0);
        gl.glRotatef(info.angle, 0, 0, 1);
        renderer.setColor(info.r, info.g, info.b, 1);
        renderer.draw(info.text, 0, 0);
        renderer.flush();
      }

      renderer.endRendering();

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
 @Override
 public void render(GL gl) {
   gl.glTranslatef(dx, dy, dz);
 }
Exemple #19
0
  public void display(GLAutoDrawable drawable) {
    GL gl = drawable.getGL();
    gl.glClear(GL.GL_COLOR_BUFFER_BIT);
    gl.glClear(GL.GL_DEPTH_BUFFER_BIT);
    gl.glLoadIdentity();
    gl.glTranslatef(0.0f, 0.0f, -5.0f);

    // Front Of House
    gl.glBegin(GL.GL_QUADS);
    gl.glColor3f(1.0f, 0.0f, 0.0f);
    gl.glVertex3f(-1.0f, 1.0f, 0.0f);
    gl.glVertex3f(1.0f, 1.0f, 0.0f);
    gl.glVertex3f(1.0f, -1.0f, 0.0f);
    gl.glVertex3f(-1.0f, -1.0f, 0.0f);
    gl.glEnd();

    // Front Left Window
    gl.glBegin(GL.GL_QUADS);
    gl.glColor3f(0.5f, 0.0f, 0.0f);
    gl.glVertex3f(-0.75f, 0.25f, 0.0f);
    gl.glVertex3f(-0.25f, 0.25f, 0.0f);
    gl.glVertex3f(-0.25f, 0.75f, 0.0f);
    gl.glVertex3f(-0.75f, 0.75f, 0.0f);
    gl.glEnd();

    // Front Right Window
    gl.glBegin(GL.GL_QUADS);
    gl.glColor3f(0.5f, 0.0f, 0.0f);
    gl.glVertex3f(0.75f, 0.25f, 0.0f);
    gl.glVertex3f(0.25f, 0.25f, 0.0f);
    gl.glVertex3f(0.25f, 0.75f, 0.0f);
    gl.glVertex3f(0.75f, 0.75f, 0.0f);
    gl.glEnd();

    // Door
    gl.glBegin(GL.GL_QUADS);
    gl.glColor3f(0.0f, 1.0f, 0.0f);
    gl.glVertex3f(-0.25f, -1.0f, 0.0f);
    gl.glVertex3f(0.25f, -1.0f, 0.0f);
    gl.glVertex3f(0.25f, -0.25f, 0.0f);
    gl.glVertex3f(-0.25f, -0.25f, 0.0f);
    gl.glEnd();

    // Right Side of house
    gl.glBegin(GL.GL_QUADS);
    gl.glColor3f(1.0f, 0.0f, 0.0f);
    gl.glVertex3f(1.0f, -1.0f, 0.0f);
    gl.glVertex3f(2.0f, -1.0f, -1.0f);
    gl.glVertex3f(2.0f, 1.0f, -1.0f);
    gl.glVertex3f(1.0f, 1.0f, 0.0f);
    gl.glEnd();

    // Right Side of roof
    gl.glBegin(GL.GL_QUADS);
    gl.glColor3f(1.0f, 0.0f, 0.0f);
    gl.glVertex3f(1.0f, 1.0f, 0.0f);
    gl.glVertex3f(2.0f, 1.0f, -1.0f);
    gl.glVertex3f(1.0f, 1.75f, -1.0f);
    gl.glVertex3f(0.0f, 2.0f, -1.0f);
    gl.glEnd();

    // Roof
    gl.glBegin(GL.GL_TRIANGLES);
    gl.glColor3f(1.0f, 0.0f, 0.0f);
    gl.glVertex3f(-1.0f, 1.0f, 0.0f);
    gl.glVertex3f(0.0f, 2.0f, -1.0f);
    gl.glVertex3f(1.0f, 1.0f, 0.0f);
    gl.glEnd();

    // Front Side Of House Outline
    gl.glBegin(GL.GL_LINE_STRIP);
    gl.glColor3f(0.0f, 0.0f, 1.0f);
    gl.glVertex3f(-1.0f, 1.0f, 0.0f);
    gl.glVertex3f(1.0f, 1.0f, 0.0f);
    gl.glVertex3f(1.0f, -1.0f, 0.0f);
    gl.glVertex3f(-1.0f, -1.0f, 0.0f);
    gl.glEnd();

    // Right Side of house outline
    gl.glBegin(GL.GL_LINE_STRIP);
    gl.glColor3f(0.0f, 0.0f, 1.0f);
    gl.glVertex3f(1.0f, -1.0f, 0.0f);
    gl.glVertex3f(2.0f, -1.0f, -1.0f);
    gl.glVertex3f(2.0f, 1.0f, -1.0f);
    gl.glVertex3f(1.0f, 1.0f, 0.0f);
    gl.glEnd();

    // Roof Outline
    gl.glBegin(GL.GL_LINE_STRIP);
    gl.glColor3f(0.0f, 0.0f, 1.0f);
    gl.glVertex3f(-1.0f, 1.0f, 0.0f);
    gl.glVertex3f(0.0f, 2.0f, -1.0f);
    gl.glVertex3f(1.0f, 1.0f, 0.0f);
    gl.glEnd();

    // Right Side of roof Outline
    gl.glBegin(GL.GL_LINE_STRIP);
    gl.glColor3f(0.0f, 0.0f, 1.0f);
    gl.glVertex3f(1.0f, 1.0f, 0.0f);
    gl.glVertex3f(2.0f, 1.0f, -1.0f);
    gl.glVertex3f(1.0f, 1.75f, -1.0f);
    gl.glVertex3f(0.0f, 2.0f, -1.0f);
    gl.glEnd();
  }