當前位置: 首頁>>代碼示例>>Java>>正文


Java GLES20.glVertexAttrib3f方法代碼示例

本文整理匯總了Java中android.opengl.GLES20.glVertexAttrib3f方法的典型用法代碼示例。如果您正苦於以下問題:Java GLES20.glVertexAttrib3f方法的具體用法?Java GLES20.glVertexAttrib3f怎麽用?Java GLES20.glVertexAttrib3f使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.opengl.GLES20的用法示例。


在下文中一共展示了GLES20.glVertexAttrib3f方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawLight

import android.opengl.GLES20; //導入方法依賴的package包/類
/**
 * Draws a point representing the position of the light.
 */
private void drawLight() {
    final int pointMVPMatrixHandle = GLES20.glGetUniformLocation(mPointProgramHandle, "u_MVPMatrix");
    final int pointPositionHandle = GLES20.glGetAttribLocation(mPointProgramHandle, "a_Position");

    // Pass in the position.
    GLES20.glVertexAttrib3f(pointPositionHandle, mLightPosInModelSpace[0], mLightPosInModelSpace[1], mLightPosInModelSpace[2]);

    // Since we are not using a buffer object, disable vertex arrays for this attribute.
    GLES20.glDisableVertexAttribArray(pointPositionHandle);

    // Pass in the transformation matrix.
    Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mLightModelMatrix, 0);
    Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0);
    GLES20.glUniformMatrix4fv(pointMVPMatrixHandle, 1, false, mMVPMatrix, 0);

    // Draw the point.
    GLES20.glDrawArrays(GLES20.GL_POINTS, 0, 1);
}
 
開發者ID:biezhihua,項目名稱:Android_OpenGL_Demo,代碼行數:22,代碼來源:Cube.java

示例2: drawLight

import android.opengl.GLES20; //導入方法依賴的package包/類
private void drawLight() {
    final int pointMVPMatrixHandle = GLES20.glGetUniformLocation(mPointProgramHandle, "u_MVPMatrix");
    final int pointPositionHandle = GLES20.glGetAttribLocation(mPointProgramHandle, "a_Position");

    // Pass in the position.
    GLES20.glVertexAttrib3f(pointPositionHandle, mLightPosInModelSpace[0], mLightPosInModelSpace[1], mLightPosInModelSpace[2]);

    // Since we are not using a buffer object, disable vertex arrays for this attribute.
    GLES20.glDisableVertexAttribArray(pointPositionHandle);

    // Pass in the transformation matrix.
    Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mLightModelMatrix, 0);
    Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0);
    GLES20.glUniformMatrix4fv(pointMVPMatrixHandle, 1, false, mMVPMatrix, 0);

    // Draw the point.
    GLES20.glDrawArrays(GLES20.GL_POINTS, 0, 1);
}
 
開發者ID:biezhihua,項目名稱:Android_OpenGL_Demo,代碼行數:19,代碼來源:LessonSixRenderer.java

示例3: drawLight

import android.opengl.GLES20; //導入方法依賴的package包/類
/**
 * Draws a point representing the position of the light.
 */
private void drawLight()
{
	final int pointMVPMatrixHandle = GLES20.glGetUniformLocation(mPointProgramHandle, "u_MVPMatrix");
       final int pointPositionHandle = GLES20.glGetAttribLocation(mPointProgramHandle, "a_Position");

	// Pass in the position.
	GLES20.glVertexAttrib3f(pointPositionHandle, mLightPosInModelSpace[0], mLightPosInModelSpace[1], mLightPosInModelSpace[2]);

	// Since we are not using a buffer object, disable vertex arrays for this attribute.
       GLES20.glDisableVertexAttribArray(pointPositionHandle);

	// Pass in the transformation matrix.
	Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mLightModelMatrix, 0);
	Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0);
	GLES20.glUniformMatrix4fv(pointMVPMatrixHandle, 1, false, mMVPMatrix, 0);

	// Draw the point.
	GLES20.glDrawArrays(GLES20.GL_POINTS, 0, 1);
}
 
開發者ID:biezhihua,項目名稱:Android_OpenGL_Demo,代碼行數:23,代碼來源:LessonTwoRenderer.java

示例4: drawLight

import android.opengl.GLES20; //導入方法依賴的package包/類
/**
 * Draws a point representing the position of the light.
 */
private void drawLight()
{
	final int pointMVPMatrixHandle = GLES20.glGetUniformLocation(mPointProgramHandle, "u_MVPMatrix");
       final int pointPositionHandle = GLES20.glGetAttribLocation(mPointProgramHandle, "a_Position");
       
	// Pass in the position.
	GLES20.glVertexAttrib3f(pointPositionHandle, mLightPosInModelSpace[0], mLightPosInModelSpace[1], mLightPosInModelSpace[2]);

	// Since we are not using a buffer object, disable vertex arrays for this attribute.
       GLES20.glDisableVertexAttribArray(pointPositionHandle);  
	
	// Pass in the transformation matrix.
	Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mLightModelMatrix, 0);
	Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0);
	GLES20.glUniformMatrix4fv(pointMVPMatrixHandle, 1, false, mMVPMatrix, 0);
	
	// Draw the point.
	GLES20.glDrawArrays(GLES20.GL_POINTS, 0, 1);
}
 
開發者ID:biezhihua,項目名稱:Android_OpenGL_Demo,代碼行數:23,代碼來源:LessonFourRenderer.java

示例5: drawLight

import android.opengl.GLES20; //導入方法依賴的package包/類
/**
 * Draws a point representing the position of the light.
 */
private void drawLight()
{
	final int pointMVPMatrixHandle = GLES20.glGetUniformLocation(mPointProgramHandle, "u_MVPMatrix");
       final int pointPositionHandle = GLES20.glGetAttribLocation(mPointProgramHandle, "a_Position");
       
	// Pass in the position.
	GLES20.glVertexAttrib3f(pointPositionHandle, mLightPosInModelSpace[0], mLightPosInModelSpace[1], mLightPosInModelSpace[2]);

	// Since we are not using a buffer object, disable vertex arrays for this attribute.
       GLES20.glDisableVertexAttribArray(pointPositionHandle);  
	
	// Pass in the transformation matrix.
	Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mLightModelMatrix, 0);
	Matrix.multiplyMM(mTemporaryMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0);
	System.arraycopy(mTemporaryMatrix, 0, mMVPMatrix, 0, 16);
	GLES20.glUniformMatrix4fv(pointMVPMatrixHandle, 1, false, mMVPMatrix, 0);
	
	// Draw the point.
	GLES20.glDrawArrays(GLES20.GL_POINTS, 0, 1);
}
 
開發者ID:biezhihua,項目名稱:Android_OpenGL_Demo,代碼行數:24,代碼來源:LessonSixRenderer.java


注:本文中的android.opengl.GLES20.glVertexAttrib3f方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。