当前位置: 首页>>代码示例>>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;未经允许,请勿转载。