Package javax.media.opengl

Examples of javax.media.opengl.GL.glVertex3f()


        gl.glTranslatef(-1.5f, 0.0f, -6.0f);

        // Drawing Using Triangles
        gl.glBegin(GL.GL_TRIANGLES);
            gl.glColor3f(1.0f, 0.0f, 0.0f);    // Set the current drawing color to red
            gl.glVertex3f(0.0f, 1.0f, 0.0f);   // Top
            gl.glColor3f(0.0f, 1.0f, 0.0f);    // Set the current drawing color to green
            gl.glVertex3f(-1.0f, -1.0f, 0.0f); // Bottom Left
            gl.glColor3f(0.0f, 0.0f, 1.0f);    // Set the current drawing color to blue
            gl.glVertex3f(1.0f, -1.0f, 0.0f)// Bottom Right
        // Finished Drawing The Triangle
View Full Code Here


        // Drawing Using Triangles
        gl.glBegin(GL.GL_TRIANGLES);
            gl.glColor3f(1.0f, 0.0f, 0.0f);    // Set the current drawing color to red
            gl.glVertex3f(0.0f, 1.0f, 0.0f);   // Top
            gl.glColor3f(0.0f, 1.0f, 0.0f);    // Set the current drawing color to green
            gl.glVertex3f(-1.0f, -1.0f, 0.0f); // Bottom Left
            gl.glColor3f(0.0f, 0.0f, 1.0f);    // Set the current drawing color to blue
            gl.glVertex3f(1.0f, -1.0f, 0.0f)// Bottom Right
        // Finished Drawing The Triangle
        gl.glEnd();
View Full Code Here

            gl.glColor3f(1.0f, 0.0f, 0.0f);    // Set the current drawing color to red
            gl.glVertex3f(0.0f, 1.0f, 0.0f);   // Top
            gl.glColor3f(0.0f, 1.0f, 0.0f);    // Set the current drawing color to green
            gl.glVertex3f(-1.0f, -1.0f, 0.0f); // Bottom Left
            gl.glColor3f(0.0f, 0.0f, 1.0f);    // Set the current drawing color to blue
            gl.glVertex3f(1.0f, -1.0f, 0.0f)// Bottom Right
        // Finished Drawing The Triangle
        gl.glEnd();

        // Move the "drawing cursor" to another position
        gl.glTranslatef(3.0f, 0.0f, 0.0f);
View Full Code Here

        // Move the "drawing cursor" to another position
        gl.glTranslatef(3.0f, 0.0f, 0.0f);
        // Draw A Quad
        gl.glBegin(GL.GL_QUADS);
            gl.glColor3f(0.5f, 0.5f, 1.0f);    // Set the current drawing color to light blue
            gl.glVertex3f(-1.0f, 1.0f, 0.0f)// Top Left
            gl.glVertex3f(1.0f, 1.0f, 0.0f);   // Top Right
            gl.glVertex3f(1.0f, -1.0f, 0.0f)// Bottom Right
            gl.glVertex3f(-1.0f, -1.0f, 0.0f); // Bottom Left
        // Done Drawing The Quad
        gl.glEnd();
View Full Code Here

        gl.glTranslatef(3.0f, 0.0f, 0.0f);
        // Draw A Quad
        gl.glBegin(GL.GL_QUADS);
            gl.glColor3f(0.5f, 0.5f, 1.0f);    // Set the current drawing color to light blue
            gl.glVertex3f(-1.0f, 1.0f, 0.0f)// Top Left
            gl.glVertex3f(1.0f, 1.0f, 0.0f);   // Top Right
            gl.glVertex3f(1.0f, -1.0f, 0.0f)// Bottom Right
            gl.glVertex3f(-1.0f, -1.0f, 0.0f); // Bottom Left
        // Done Drawing The Quad
        gl.glEnd();
View Full Code Here

        // Draw A Quad
        gl.glBegin(GL.GL_QUADS);
            gl.glColor3f(0.5f, 0.5f, 1.0f);    // Set the current drawing color to light blue
            gl.glVertex3f(-1.0f, 1.0f, 0.0f)// Top Left
            gl.glVertex3f(1.0f, 1.0f, 0.0f);   // Top Right
            gl.glVertex3f(1.0f, -1.0f, 0.0f)// Bottom Right
            gl.glVertex3f(-1.0f, -1.0f, 0.0f); // Bottom Left
        // Done Drawing The Quad
        gl.glEnd();

        // Flush all drawing operations to the graphics card
View Full Code Here

        gl.glBegin(GL.GL_QUADS);
            gl.glColor3f(0.5f, 0.5f, 1.0f);    // Set the current drawing color to light blue
            gl.glVertex3f(-1.0f, 1.0f, 0.0f)// Top Left
            gl.glVertex3f(1.0f, 1.0f, 0.0f);   // Top Right
            gl.glVertex3f(1.0f, -1.0f, 0.0f)// Bottom Right
            gl.glVertex3f(-1.0f, -1.0f, 0.0f); // Bottom Left
        // Done Drawing The Quad
        gl.glEnd();

        // Flush all drawing operations to the graphics card
        gl.glFlush();
View Full Code Here

    gl.glBegin(GL.GL_QUAD_STRIP);


    for (i = 0; i <= teeth; i++) {
      angle = i * 2.0f * (float) Math.PI / teeth;
      gl.glVertex3f(r1 * (float) Math.cos(angle), r1
          * (float) Math.sin(angle), -width * 0.5f);
      gl.glVertex3f(r0 * (float) Math.cos(angle), r0
          * (float) Math.sin(angle), -width * 0.5f);
      gl.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1
          * (float) Math.sin(angle + 3 * da), -width * 0.5f);
 
View Full Code Here

    for (i = 0; i <= teeth; i++) {
      angle = i * 2.0f * (float) Math.PI / teeth;
      gl.glVertex3f(r1 * (float) Math.cos(angle), r1
          * (float) Math.sin(angle), -width * 0.5f);
      gl.glVertex3f(r0 * (float) Math.cos(angle), r0
          * (float) Math.sin(angle), -width * 0.5f);
      gl.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1
          * (float) Math.sin(angle + 3 * da), -width * 0.5f);
      gl.glVertex3f(r0 * (float) Math.cos(angle), r0
          * (float) Math.sin(angle), -width * 0.5f);
 
View Full Code Here

      angle = i * 2.0f * (float) Math.PI / teeth;
      gl.glVertex3f(r1 * (float) Math.cos(angle), r1
          * (float) Math.sin(angle), -width * 0.5f);
      gl.glVertex3f(r0 * (float) Math.cos(angle), r0
          * (float) Math.sin(angle), -width * 0.5f);
      gl.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1
          * (float) Math.sin(angle + 3 * da), -width * 0.5f);
      gl.glVertex3f(r0 * (float) Math.cos(angle), r0
          * (float) Math.sin(angle), -width * 0.5f);
    }
    gl.glEnd();
 
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.