Package org.lwjgl.test.opengles.util

Examples of org.lwjgl.test.opengles.util.Geometry.addDrawCommand()


    }

    // draw outward faces of teeth
    // OpenGL ES 2.0 note: This needs to be converted to a triangle
    // list with face normals to get the flat look of the original.
    lastDrawIndex += gear.addDrawCommand(GL_TRIANGLE_STRIP, lastDrawIndex, teeth * 8 + 2);
    for ( i = 0; i < teeth; i++ ) {
      angle = i * 2.0f * (float)Math.PI / teeth;

      imb.glNormal3f(cos(angle), sin(angle), 0.0f);
      imb.glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5f);
 
View Full Code Here


    imb.glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5f);

    //glShadeModel(GL_SMOOTH);

    // draw inside radius cylinder
    lastDrawIndex += gear.addDrawCommand(GL_TRIANGLE_STRIP, lastDrawIndex, (teeth + 1) * 2);
    for ( i = 0; i <= teeth; i++ ) {
      angle = i * 2.0f * (float)Math.PI / teeth;

      imb.glNormal3f(-cos(angle), -sin(angle), 0.0f);
      imb.glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5f);
 
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.