Examples of glBegin()


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

//      gl.glMultMatrixd(Matrix4.pack(shape.getTransform()),0);
     
      gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_FILL);
      Iterator<Vector3[]> i = shape.getFaces();
      while (i.hasNext()) {
        gl.glBegin(GL.GL_POLYGON);
        Vector3[] face = i.next();
        //compute normal
        Vector3 n =face[1].sub(face[0]).cross(face[2].sub(face[1])).normalize();
       
        for ( Vector3 v: face) {
View Full Code Here

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

      gl.glLineWidth(1.7f);
      gl.glDisable(GL.GL_LIGHTING);
      gl.glScaled(1.01, 1.01, 1.01);
      i = shape.getFaces();
      while (i.hasNext()) {
        gl.glBegin(GL.GL_POLYGON);
        Vector3[] face = i.next();
        //compute normal
        Vector3 n =face[1].sub(face[0]).cross(face[2].sub(face[1])).normalize();
       
        for ( Vector3 v: face) {
View Full Code Here

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


      gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL.GL_FILL);
      Iterator<Vector3[]> i = shape.getFaces();
      while (i.hasNext()) {
        gl.glBegin(GL.GL_POLYGON);
        Vector3[] face = i.next();
        for ( Vector3 v: face) {
          gl.glVertex3d(v.x, v.y, v.z);
        }
        gl.glEnd();
View Full Code Here

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

        // Move the "drawing cursor" around
        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
View Full Code Here

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

        gl.glEnd();

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

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

    gl.glRotatef(30, 1.0f, 0, 0);
    gl.glRotatef(40, 0, 1.0f, 0);
    gl.glRotatef(50, 0, 0, 1.0f);
    gl.glRotatef(rot, 1.0f, 1.0f, 1.0f);
    gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 0);
    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
View Full Code Here

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

    }
    // start new primitive if necessary
    if(primitive != null && ended) {
      GL gl = drawable.getGL();
      if(primitive == Primitive.POINT) {
        gl.glBegin(GL.GL_POINTS);
      }
      if(primitive == Primitive.LINE) {
        gl.glBegin(GL.GL_LINES);
      }
      if(primitive == Primitive.TRIANGLE || primitive == Primitive.TEXTURED_TRIANGLE) {
View Full Code Here

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

      GL gl = drawable.getGL();
      if(primitive == Primitive.POINT) {
        gl.glBegin(GL.GL_POINTS);
      }
      if(primitive == Primitive.LINE) {
        gl.glBegin(GL.GL_LINES);
      }
      if(primitive == Primitive.TRIANGLE || primitive == Primitive.TEXTURED_TRIANGLE) {
        gl.glBegin(GL.GL_TRIANGLES);
      }
      if(primitive == Primitive.IMAGE) {
View Full Code Here

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

      }
      if(primitive == Primitive.LINE) {
        gl.glBegin(GL.GL_LINES);
      }
      if(primitive == Primitive.TRIANGLE || primitive == Primitive.TEXTURED_TRIANGLE) {
        gl.glBegin(GL.GL_TRIANGLES);
      }
      if(primitive == Primitive.IMAGE) {
        gl.glBegin(GL.GL_QUADS);
      }
     
View Full Code Here

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

      }
      if(primitive == Primitive.TRIANGLE || primitive == Primitive.TEXTURED_TRIANGLE) {
        gl.glBegin(GL.GL_TRIANGLES);
      }
      if(primitive == Primitive.IMAGE) {
        gl.glBegin(GL.GL_QUADS);
      }
     
      ended = false;
    }
    drawable.setLastImage(image);
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.