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


Java Matrix.perspectiveM方法代码示例

本文整理汇总了Java中android.opengl.Matrix.perspectiveM方法的典型用法代码示例。如果您正苦于以下问题:Java Matrix.perspectiveM方法的具体用法?Java Matrix.perspectiveM怎么用?Java Matrix.perspectiveM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.opengl.Matrix的用法示例。


在下文中一共展示了Matrix.perspectiveM方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onDrawFrame

import android.opengl.Matrix; //导入方法依赖的package包/类
@Override
public void onDrawFrame(int textureId) {
    super.onDrawFrame(textureId);
    glSphereProgram.use();
    sphere.uploadTexCoordinateBuffer(glSphereProgram.getTextureCoordinateHandle());
    sphere.uploadVerticesBuffer(glSphereProgram.getPositionHandle());

    Matrix.perspectiveM(projectionMatrix, 0, 90, ratio, 1f, 500f);

    Matrix.multiplyMM(modelViewMatrix, 0, viewMatrix, 0, modelMatrix, 0);
    Matrix.multiplyMM(mMVPMatrix, 0, projectionMatrix, 0, modelViewMatrix, 0);

    GLES20.glUniformMatrix4fv(glSphereProgram.getMVPMatrixHandle(), 1, false, mMVPMatrix, 0);

    TextureUtils.bindTexture2D(textureId, GLES20.GL_TEXTURE0,glSphereProgram.getTextureSamplerHandle(),0);

    sphere.draw();
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:19,代码来源:SphereReflector.java

示例2: StereoDiveEffect

import android.opengl.Matrix; //导入方法依赖的package包/类
public StereoDiveEffect(Context context) {
    mDpm = new DisplayMetrics();
    mActivity = context;
    getWindowManager(context).getDefaultDisplay().getMetrics(mDpm);
    generateVideoVertices();
    generateVideoTextures();
    generateUITextures();
    
    mCamera = new float[16];
    mPersp = new float[16];
    mMVP = new float[16];
    mHeadTransform = new float[16];
    mAngleOrigin = new float[3];
    
    Matrix.setIdentityM(mHeadTransform, 0);
    Matrix.perspectiveM(mPersp, 0, EYE_FOV, 1.0f, 0.0f, -(1.5f*SCREEN_FAR));
    mRightEyePos = new float[] { 0.0f, -IPD/2.0f, 0.0f };
    mLeftEyePos = new float[] { 0.0f, IPD/2.0f, 0.0f };
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:20,代码来源:StereoDiveEffect.java

示例3: onSurfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
@Override
public void onSurfaceChanged(GL10 unused, int width, int height) {
  GLES20.glViewport(0, 0, width, height);
  float aspectRatio = (float) width / height;
  // Recompute the projection matrix, because it depends on the aspect ration of the display.
  Matrix.perspectiveM(projMatrix, 0, FOV_Y, aspectRatio, NEAR_CLIP, FAR_CLIP);
}
 
开发者ID:googlevr,项目名称:poly-sample-android,代码行数:8,代码来源:MyGLRenderer.java

示例4: onSurfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
@Override
public void onSurfaceChanged(GL10 unused, int width, int height) {
    GLES20.glViewport(0, 0, width, height);

    Matrix.perspectiveM(mProjectionMatrix, 0, 45, (float) width / height, 1f, 10f);

    Matrix.setIdentityM(mModelMatrix, 0);
    Matrix.translateM(mModelMatrix, 0, 0f, 0f, -2.5f);
    Matrix.rotateM(mModelMatrix, 0, -60f, 1f, 0f, 0f);
    Matrix.multiplyMM(mTmpMatrix, 0, mProjectionMatrix, 0, mModelMatrix, 0);
    System.arraycopy(mTmpMatrix, 0, mProjectionMatrix, 0, mTmpMatrix.length);
}
 
开发者ID:Piasy,项目名称:OpenGLESTutorial-Android,代码行数:13,代码来源:DemoRenderer.java

示例5: onSurfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
@Override
public void onSurfaceChanged(GL10 unused, int width, int height) {
    GLES20.glViewport(0, 0, width, height);

    float ratio = (float) width / height;
    Matrix.perspectiveM(mProjectionMatrix, 0, 90, ratio, 0.1f, 7.f);
}
 
开发者ID:PacktPublishing,项目名称:Building-Android-UIs-with-Custom-Views,代码行数:8,代码来源:GLDrawer.java

示例6: updateViewPortAndProjection

import android.opengl.Matrix; //导入方法依赖的package包/类
public void updateViewPortAndProjection(int width, int height) {
    GLES31.glViewport(0, 0, width, height);
    mSurfaceAspectRatio = (float) width / height;

    // this projection matrix is applied to object coordinates
    Matrix.perspectiveM(mProjectionMatrix, 0, 45.0f, mSurfaceAspectRatio, 0.1f, 30.0f);
}
 
开发者ID:WissamElkadi,项目名称:TriMeshKit,代码行数:8,代码来源:RenderingShader.java

示例7: setScaleFactor

import android.opengl.Matrix; //导入方法依赖的package包/类
public void setScaleFactor(float _scaleFactor) {
    Matrix.perspectiveM(mProjectionMatrix, 0, 45.0f / _scaleFactor, mSurfaceAspectRatio, 0.1f, 30.0f);
}
 
开发者ID:WissamElkadi,项目名称:TriMeshKit,代码行数:4,代码来源:RenderingShader.java

示例8: onSurfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
public void onSurfaceChanged(GL10 unused, int width, int height) {
    GLES20.glViewport(0, 0, width, height);

    float ratio = (float)width/(float)height;

    Matrix.perspectiveM(projection, 0, 45.0f, ratio, 0.1f, 10.0f);
}
 
开发者ID:snada,项目名称:BitmapFontLoader,代码行数:8,代码来源:MainActivity.java


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