當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。