GL10 glNormalPointer - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for GL10 glNormalPointer method.

This code example shows how to use the following methods:glColorPointer, glEnableClientState, glNormalPointer, glTexCoordPointer, glVertexPointer
	// D: perform all required binding/state changes before rendering batches. 
	//    USAGE: call once before calling draw() multiple times for this buffer. 
	// A: [none] 
	// R: [none] 
	public void bind() { 
		gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); // Enable Position in Vertices
		vertices.position(0);                        // Set Vertex Buffer to Position
		gl.glVertexPointer(positionCnt, GL10.GL_FLOAT, vertexSize, vertices);  // Set Vertex Pointer
 
		if (hasColor) {                            // IF Vertices Have Color
			gl.glEnableClientState(GL10.GL_COLOR_ARRAY);  // Enable Color in Vertices
			vertices.position(positionCnt);            // Set Vertex Buffer to Color
			gl.glColorPointer(COLOR_CNT, GL10.GL_FLOAT, vertexSize, vertices);  // Set Color Pointer
		} 
 
		if (hasTexCoords) {                        // IF Vertices Have Texture Coords
			gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);  // Enable Texture Coords in Vertices
			vertices.position(positionCnt + (hasColor ? COLOR_CNT : 0));  // Set Vertex Buffer to Texture Coords (NOTE: position based on whether color is also specified)
			gl.glTexCoordPointer(TEXCOORD_CNT, GL10.GL_FLOAT, vertexSize, vertices);  // Set Texture Coords Pointer
		} 

7
CodeRank
This code example shows how to use the following methods:glBindBuffer, glDrawElements, glNormalPointer, glVertexPointer
7
CodeRank
This code example shows how to use the following methods:glClientActiveTexture, glBindBuffer, glTexCoordPointer, glVertexPointer
This code example shows how to use the following methods:glBindBuffer, glDrawElements, glNormalPointer, glVertexPointer
6
CodeRank
This code example shows how to use the following methods:glColor4f, glDrawArrays, glEnableClientState, glNormalPointer, glVertexPointer
6
CodeRank
This code example shows how to use the following methods:glColorPointer, glDrawElements, glNormalPointer, glPopMatrix, glPushMatrix
	 * Rectangle * 
	 *************/ 
	 
	public static void drawRect(GL10 gl, float x, float y, float z, float w, float h, String color)
	{         
        gl.glPushMatrix();
         
        gl.glTranslatef(x, y, z);
        gl.glScalef(w, h, 1.0f);
 
        gl.glVertexPointer(3, GL10.GL_FLOAT, 0, cubeCoordsBuffer);
        gl.glColorPointer(4, GL10.GL_FLOAT, 0, getColorBuffer(color));
        gl.glNormalPointer(GL10.GL_FLOAT, 0, cubeNormalsBuffer);
        gl.glDrawElements(GL10.GL_TRIANGLES, 2 * 3, GL10.GL_UNSIGNED_SHORT, rectIndecesBuffer);
         
        gl.glPopMatrix();
	} 
	 
	public static void drawRectLidar(GL10 gl, float x, float y, float z, float w, float h, String color)
	{         
	    gl.glPushMatrix();
6
CodeRank
This code example shows how to use the following methods:glDrawElements, glEnable, glFrontFace, glTexCoordPointer, glVertexPointer
This code example shows how to use the following methods:glClearColor, glClearDepthf, glDepthFunc, glEnable, glHint
	/** 
	 * The Surface is created/init() 
	 */ 
	public void onSurfaceCreated(GL10 gl, EGLConfig config) {
 
		gl.glShadeModel(GL10.GL_SMOOTH); // Enable Smooth Shading
		gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
		gl.glClearDepthf(1.0f); // Depth Buffer Setup
		gl.glEnable(GL10.GL_DEPTH_TEST); // Enables Depth Testing
		gl.glDepthFunc(GL10.GL_LEQUAL); // The Type Of Depth Testing To Do
 
		// Really Nice Perspective Calculations 
		gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);
 
	} 
 
	/** 
	 * Here we do our drawing 
	 */ 
	public void onDrawFrame(GL10 gl) {
8
CodeRank
This code example shows how to use the following methods:glClearColor, glDisable, glEnable, glEnableClientState, glShadeModel
        /* 
         * By default, OpenGL enables features that improve quality 
         * but reduce performance. One might want to tweak that 
         * especially on software renderer. 
         */ 
        gl.glDisable(GL10.GL_DITHER);
 
        /* 
         * Some one-time OpenGL initialization can be made here 
         * probably based on features of this particular context 
         */ 
        gl.glClearColor(1,1,1,1);
        gl.glEnable(GL10.GL_CULL_FACE);
        gl.glShadeModel(GL10.GL_SMOOTH);
        gl.glEnable(GL10.GL_DEPTH_TEST);
 
        /* 
         * create / load the our 3D models here 
         */ 
 

8
CodeRank
This code example shows how to use the following methods:glFrustumf, glLoadIdentity, glMatrixMode, glViewport
    } 
 
    public void onSurfaceChanged(GL10 gl, int w, int h) {
        mWidth = w;
        mHeight = h;
        gl.glViewport(0, 0, w, h);
        mProjector.setCurrentView(0, 0, w, h);
 
        /* 
        * Set our projection matrix. This doesn't have to be done 
        * each time we draw, but usually a new projection needs to 
        * be set when the viewport is resized. 
        */ 
 
        float ratio = (float) w / h;
        gl.glMatrixMode(GL10.GL_PROJECTION);
        gl.glLoadIdentity();
        gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10);
        mProjector.getCurrentProjection(gl);
    } 

8
CodeRank

Related GL10 glNormalPointer Questions & Answers: