本文整理汇总了Java中android.opengl.GLES30.glEnable方法的典型用法代码示例。如果您正苦于以下问题:Java GLES30.glEnable方法的具体用法?Java GLES30.glEnable怎么用?Java GLES30.glEnable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.opengl.GLES30
的用法示例。
在下文中一共展示了GLES30.glEnable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDrawEye
import android.opengl.GLES30; //导入方法依赖的package包/类
/**
* Draws a frame for an eye.
*
* @param eye The eye to render. Includes all required transformations.
*/
@Override
public void onDrawEye(Eye eye) {
// Clear the color buffer set above by glClearColor.
GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT | GLES30.GL_DEPTH_BUFFER_BIT);
//need this otherwise, it will over right stuff and the cube will look wrong!
GLES30.glEnable(GLES30.GL_DEPTH_TEST);
// Apply the eye transformation to the camera.
Matrix.multiplyMM(view, 0, eye.getEyeView(), 0, camera, 0);
// combine the model with the view matrix to create the modelview matreix
Matrix.multiplyMM(modelview, 0, view, 0, mRotationMatrix, 0);
// combine the model-view with the projection matrix
float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);
Matrix.multiplyMM(mMVPMatrix, 0, perspective, 0, modelview, 0);
//finally draw the cube with the full Model-view-projection matrix.
mCube.draw(mMVPMatrix);
}
示例2: onDrawFrame
import android.opengl.GLES30; //导入方法依赖的package包/类
@Override
public void onDrawFrame(GL10 glUnused) {
// Clear the color buffer set above by glClearColor.
GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT | GLES30.GL_DEPTH_BUFFER_BIT);
//need this otherwise, it will over right stuff and the cube will look wrong!
GLES30.glEnable(GLES30.GL_DEPTH_TEST);
// Set the camera position (View matrix) note Matrix is an include, not a declared method.
Matrix.setLookAtM(mViewMatrix, 0, 0, 0, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
// Create a rotation and translation for the cube
Matrix.setIdentityM(mRotationMatrix, 0);
//move the cube up/down and left/right
Matrix.translateM(mRotationMatrix, 0, mTransX, mTransY, 0);
//mangle is how fast, x,y,z which directions it rotates.
Matrix.rotateM(mRotationMatrix, 0, mAngle, 0.4f, 1.0f, 0.6f);
// combine the model with the view matrix
Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mRotationMatrix, 0);
// combine the model-view with the projection matrix
Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0);
mPyramid.draw(mMVPMatrix);
//change the angle, so the cube will spin.
mAngle+=.4;
}
示例3: onDrawEye
import android.opengl.GLES30; //导入方法依赖的package包/类
/**
* Draws a frame for an eye.
*
* @param eye The eye to render. Includes all required transformations.
*/
@Override
public void onDrawEye(Eye eye) {
// Clear the color buffer set above by glClearColor.
GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT | GLES30.GL_DEPTH_BUFFER_BIT);
//need this otherwise, it will over right stuff and the cube will look wrong!
GLES30.glEnable(GLES30.GL_DEPTH_TEST);
// Apply the eye transformation to the camera.
Matrix.multiplyMM(view, 0, eye.getEyeView(), 0, camera, 0);
// Set the position of the light
Matrix.multiplyMV(lightPosInEyeSpace, 0, view, 0, LIGHT_POS_IN_WORLD_SPACE, 0);
// combine the model with the view matrix to create the modelview matreix
Matrix.multiplyMM(modelview, 0, view, 0, CubeMatrix0, 0);
// combine the model-view with the projection matrix
float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);
Matrix.multiplyMM(mMVPMatrix, 0, perspective, 0, modelview, 0);
//finally draw the cube with the full Model-view-projection matrix.
mCube.draw(mMVPMatrix);
//now create the mvp matrix for cube2 and then draw it.
// combine the model with the view matrix to create the modelview matreix
Matrix.multiplyMM(modelview, 0, view, 0, CubeMatrix1, 0);
// combine the model-view with the projection matrix
Matrix.multiplyMM(mMVPMatrix, 0, perspective, 0, modelview, 0);
mPyramid.draw(mMVPMatrix);
//now the next 5
Matrix.multiplyMM(modelview, 0, view, 0, CubeMatrix2, 0);
Matrix.multiplyMM(mMVPMatrix, 0, perspective, 0, modelview, 0);
mPyramid.draw(mMVPMatrix);
Matrix.multiplyMM(modelview, 0, view, 0, CubeMatrix3, 0);
Matrix.multiplyMM(mMVPMatrix, 0, perspective, 0, modelview, 0);
mCube.draw(mMVPMatrix);
Matrix.multiplyMM(modelview, 0, view, 0, CubeMatrix4, 0);
Matrix.multiplyMM(mMVPMatrix, 0, perspective, 0, modelview, 0);
mCube.draw(mMVPMatrix);
Matrix.multiplyMM(modelview, 0, view, 0, CubeMatrix5, 0);
Matrix.multiplyMM(mMVPMatrix, 0, perspective, 0, modelview, 0);
mCube.draw(mMVPMatrix);
Matrix.multiplyMM(modelview, 0, view, 0, CubeMatrix6, 0);
Matrix.multiplyMM(mMVPMatrix, 0, perspective, 0, modelview, 0);
mPyramid.draw(mMVPMatrix);
Matrix.multiplyMM(modelview, 0, view, 0, CubeMatrix7, 0);
Matrix.multiplyMM(mMVPMatrix, 0, perspective, 0, modelview, 0);
mPyramid.draw(mMVPMatrix);
//now calculate for the floor
Matrix.multiplyMM(modelview, 0, view, 0, modelFloor, 0);
// combine the model-view with the projection matrix
Matrix.multiplyMM(mMVPMatrix, 0, perspective, 0, modelview, 0);
mFloor.drawFloor(mMVPMatrix, modelFloor, modelview, lightPosInEyeSpace);
}
示例4: glEnable
import android.opengl.GLES30; //导入方法依赖的package包/类
@Override
public void glEnable(int capability)
{
GLES30.glEnable(capability);
}
示例5: onDrawFrame
import android.opengl.GLES30; //导入方法依赖的package包/类
public void onDrawFrame(GL10 glUnused) {
// Clear the color buffer set above by glClearColor.
GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT | GLES30.GL_DEPTH_BUFFER_BIT);
//need this otherwise, it will over right stuff and the cube will look wrong!
GLES30.glEnable(GLES30.GL_DEPTH_TEST);
// Set the camera position (View matrix) note Matrix is an include, not a declared method.
Matrix.setLookAtM(mViewMatrix, 0, 0, 0, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
// Create a rotation and translation for the cube
Matrix.setIdentityM(mRotationMatrix, 0);
//move the cube up/down and left/right
Matrix.translateM(mRotationMatrix, 0, mTransX, mTransY, 0);
//mangle is how fast, x,y,z which directions it rotates.
Matrix.rotateM(mRotationMatrix, 0, mAngle, 1.0f, 1.0f, 1.0f);
// combine the model with the view matrix
Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mRotationMatrix, 0);
// combine the model-view with the projection matrix
Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0);
mCube.draw(mMVPMatrix);
//change the angle, so the cube will spin.
mAngle+=.4;
}
示例6: onDrawFrame
import android.opengl.GLES30; //导入方法依赖的package包/类
public void onDrawFrame(GL10 glUnused) {
// Clear the color buffer set above by glClearColor.
GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT | GLES30.GL_DEPTH_BUFFER_BIT);
//need this otherwise, it will over right stuff and the cube will look wrong!
GLES30.glEnable(GLES30.GL_DEPTH_TEST);
// Set the camera position (View matrix) note Matrix is an include, not a declared method.
Matrix.setLookAtM(mViewMatrix, 0, 0, 0, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
// Create a rotation and translation for the cube
Matrix.setIdentityM(mRotationMatrix, 0);
//move the cube up/down and left/right
Matrix.translateM(mRotationMatrix, 0, mTransX, mTransY, 0);
//mangle is how fast, x,y,z which directions it rotates.
Matrix.rotateM(mRotationMatrix, 0, mAngle, 1.0f, 1.0f, 1.0f);
// combine the model with the view matrix
Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mRotationMatrix, 0);
// combine the model-view with the projection matrix
Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0);
mCube.draw(mMVPMatrix);
//change the angle, so the cube will spin.
mAngle+=.4;
}