But my question is from where glDrawArrays() get the points? In this example and it works fine taking the point from mLightPosInModelSpace. GLES20.glDrawArrays(GLES20.GL_POINTS, 0, 1) Īnd see that after enabling vertex Attribute Array glDrawArrays() get points from that enabled array. GLES20.glUniformMatrix4fv(pointMVPMatrixHandle, 1, false, mMVPMatrix, 0) Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0) Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mLightModelMatrix, 0) GLES20.glDisableVertexAttribArray(pointPositionHandle) Since we are not using a buffer object, disable vertex arrays for this attribute. GLES20.glVertexAttrib3f(pointPositionHandle, mLightPosInModelSpace, mLightPosInModelSpace, mLightPosInModelSpace) private void drawLight()įinal int pointMVPMatrixHandle = GLES20.glGetUniformLocation(mPointProgramHandle, "u_MVPMatrix") įinal int pointPositionHandle = GLES20.glGetAttribLocation(mPointProgramHandle, "a_Position") The following function is used to draw the point with disabled Vertex Attribute Array. Calling glBindBuffer with target set to GLARRAYBUFFER, GLELEMENTARRAYBUFFER, GLPIXELPACKBUFFER or GLPIXELUNPACKBUFFER and buffer set to the name of the new buffer object binds the buffer object name to the target. Here is a light point with 4 numbers: private final float mLightPosInModelSpace = new float glBindBuffer lets you create or use a named buffer object. I am working with code segment taken from the following site: I have started learning Opengl ES 2.0 for android.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |