• drawSelf(int texId)格式对应


    public void drawSelf(<span style="color:#cc0000;">int textureId0,int textureId1</span>){
    		MatrixState.pushMatrix();
    		MatrixState.scale(SPIRIT_SCALE,SPIRIT_SCALE,SPIRIT_SCALE);
    		MatrixState.rotate(90, 1, 0, 0);
    		loadPart[0].drawSelf(textureId1);
    		loadPart[1].drawSelf(textureId0);
    		loadPart[2].drawSelf(textureId1);
    		
    		MatrixState.popMatrix();
    	}


    public void drawSelf(<strong><span style="color:#ff0000;">int texId</span></strong>) {
    		GLES20.glUseProgram(mProgram);
    		GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, MatrixState.getFinalMatrix(), 0);
    		GLES20.glUniformMatrix4fv(muMMatrixHandle, 1, false, MatrixState.getMMatrix(), 0);
    		GLES20.glUniform3fv(muLightLocationHandle, 1, MatrixState.lightPositionFB);
    		GLES20.glUniform3fv(muCameraHandle, 1, MatrixState.cameraFB);
    		
    		GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false, 3 * 4, mVertexBuffer);
    		GLES20.glVertexAttribPointer(maNormalHandle, 3, GLES20.GL_FLOAT, false, 3*4, mNormalBuffer);
    		
    		GLES20.glEnableVertexAttribArray(maPositionHandle);
    		GLES20.glEnableVertexAttribArray(maNormalHandle);
    		
    		switch(flag){
    		case 0:
    			GLES20.glVertexAttribPointer(maTexCoorHandle, 2, GLES20.GL_FLOAT, false, 2 * 4, mTexCoorBuffer);
    			GLES20.glEnableVertexAttribArray(maTexCoorHandle);
    			GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
    			GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, texId);
    			break;
    		case 1:
    			GLES20.glActiveTexture(GLES20.GL_TEXTURE_CUBE_MAP);
    		    GLES20.glBindTexture(GLES20.GL_TEXTURE_CUBE_MAP, texId);
    			break;
    		}


  • 相关阅读:
    ab(http)与abs(https)压测工具
    Q_DECLARE_PRIVATE与Q_DECLARE_PUBLIC
    QMetaObject::connectSlotsByName
    使用QStringBuilder进行字符串连接
    源码必须是UTF-8,QString需要它
    Qt开发中文显示乱码
    qDebug 的使用
    qt 4.6 qmake Reference
    qmake-variable-reference
    Qt学习网站
  • 原文地址:https://www.cnblogs.com/Anzhongliu/p/6092056.html
Copyright © 2020-2023  润新知