android 中使用GLSurfaceView 要实现它的手势放大缩小功能,效果需要平滑,有大侠知道么
擎星 2014-04-09 02:14:25 我自己通过改变这个对象的绝对布局可以实现,但是出现卡顿的效果,(因为我们的布局都是用绝对布局的)。有大神推荐我使用 public void scale(float sx, float sy, float sz) {
Matrix.scaleM(mMatrices, mCurrentMatrixIndex, sx, sy, sz);
}
private void setMatrix(ShaderParameter[] params, float x, float y, float width, float height) {
Matrix.translateM(mTempMatrix, 0, mMatrices, mCurrentMatrixIndex, x, y, 0f);
Matrix.scaleM(mTempMatrix, 0, width, height, 1f);
Matrix.multiplyMM(mTempMatrix, MATRIX_SIZE, mProjectionMatrix, 0, mTempMatrix, 0);
GLES20.glUniformMatrix4fv(params[INDEX_MATRIX].handle, 1, false, mTempMatrix, MATRIX_SIZE);
checkError();
}
这两个函数,但是不知道怎么用,对OpenGL不太熟,求大家指点啊