当前位置: 首页>>代码示例>>Java>>正文


Java GLES30.glEnable方法代码示例

本文整理汇总了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);

}
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:28,代码来源:myStereoRenderer.java

示例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;
}
 
开发者ID:JimSeker,项目名称:opengl,代码行数:32,代码来源:myRenderer.java

示例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);
}
 
开发者ID:JimSeker,项目名称:CardBoardVR,代码行数:63,代码来源:myStereoRenderer.java

示例4: glEnable

import android.opengl.GLES30; //导入方法依赖的package包/类
@Override
public void glEnable(int capability)
{
    GLES30.glEnable(capability);
}
 
开发者ID:sriharshachilakapati,项目名称:SilenceEngine,代码行数:6,代码来源:AndroidGraphicsDevice.java

示例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;

    }
 
开发者ID:JimSeker,项目名称:opengl,代码行数:34,代码来源:myRenderer.java

示例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;

    }
 
开发者ID:JimSeker,项目名称:opengl,代码行数:33,代码来源:myRenderer.java


注:本文中的android.opengl.GLES30.glEnable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。