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


Java Matrix.frustumM方法代码示例

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


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

示例1: onSurfaceChanged

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

        final float ratio = (float) width / height;
        final float left = -ratio;
        final float right = ratio;
        final float bottom = -1.0f;
        final float top = 1.0f;
        final float near = 2.0f;
        final float far = 10.0f;

        // this projection matrix is applied to object coordinates
        // in the onDrawFrame() method
//        Matrix.frustumM(mProjectionMatrix, 0, -ratio, ratio, -1, 1, 3, 7);
        Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far);
    }
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:17,代码来源:MyGLRenderer.java

示例2: onSurfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
@Override
public void onSurfaceChanged(GL10 glUnused, int width, int height) {
	// Set the OpenGL viewport to the same size as the surface.
	GLES20.glViewport(0, 0, width, height);

	// Create a new perspective projection matrix. The height will stay the
	// same while the width will vary as per aspect ratio.
	final float ratio = (float) width / height;
	final float left = -ratio;
	final float right = ratio;
	final float bottom = -1.0f;
	final float top = 1.0f;
	final float near = 1.0f;
	final float far = 1000.0f;

	Matrix.frustumM(projectionMatrix, 0, left, right, bottom, top, near, far);
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:18,代码来源:LessonEightRenderer.java

示例3: onSurfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
@Override
public void onSurfaceChanged(GL10 glUnused, int width, int height) {
	// Set the OpenGL viewport to the same size as the surface.
	GLES20.glViewport(0, 0, width, height);

	// Create a new perspective projection matrix. The height will stay the
	// same
	// while the width will vary as per aspect ratio.
	final float ratio = (float) width / height;
	final float left = -ratio;
	final float right = ratio;
	final float bottom = -1.0f;
	final float top = 1.0f;
	final float near = 1.0f;
	final float far = 10.0f;
	
	Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far);
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:19,代码来源:GLLayer.java

示例4: onSurfaceChanged

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

	_width = width;
	_height = height;

	// Set the OpenGL viewport to the same size as the surface.
	GLES20.glViewport(0, 0, width, height);

	// Create a new perspective projection matrix. The height will stay the same
	// while the width will vary as per aspect ratio.
	final float ratio = (float) width / height;
	final float left = -ratio;
	final float right = ratio;
	final float bottom = -1.0f;
	final float top = 1.0f;
	final float near = 1.0f;
	final float far = 5000.0f;

	Matrix.frustumM(aProjectionMatrix, 0, left, right, bottom, top, near, far);
}
 
开发者ID:regar007,项目名称:ShapesInOpenGLES2.0,代码行数:23,代码来源:ShapeRenderer.java

示例5: onSurfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
@Override
public void onSurfaceChanged(GL10 glUnused, int width, int height) 
{
	// Set the OpenGL viewport to the same size as the surface.
	GLES20.glViewport(0, 0, width, height);

	// Create a new perspective projection matrix. The height will stay the same
	// while the width will vary as per aspect ratio.
	final float ratio = (float) width / height;
	final float left = -ratio;
	final float right = ratio;
	final float bottom = -1.0f;
	final float top = 1.0f;
	final float near = 1.0f;
	final float far = 10.0f;
	
	Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far);
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:19,代码来源:LessonFiveRenderer.java

示例6: onSurfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
@Override
public void onSurfaceChanged(GL10 glUnused, int width, int height) 
{
	// Set the OpenGL viewport to the same size as the surface.
	GLES20.glViewport(0, 0, width, height);

	// Create a new perspective projection matrix. The height will stay the same
	// while the width will vary as per aspect ratio.
	final float ratio = (float) width / height;
	final float left = -ratio;
	final float right = ratio;
	final float bottom = -1.0f;
	final float top = 1.0f;
	final float near = 1.0f;
	final float far = 1000.0f;
	
	Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far);
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:19,代码来源:LessonSixRenderer.java

示例7: initProjectionMatrix

import android.opengl.Matrix; //导入方法依赖的package包/类
public void initProjectionMatrix(int width, int height) {
    // Set the OpenGL viewport to the same size as the surface.
    GLES20.glViewport(0, 0, width, height);

    // Create a new perspective projection matrix.
    // The height will stay the same.
    // while the width will vary as per aspect ratio.
    final float ratio = (float) width / height;
    final float left = -ratio;
    final float right = ratio;
    final float bottom = -1.0f;
    final float top = 1.0f;
    final float near = 1.0f;
    final float far = 10.0f;

    Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far);
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:18,代码来源:Cube.java

示例8: onSurfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
@Override
public void onSurfaceChanged(GL10 glUnused, int width, int height) {
    // Set the OpenGL viewport to the same size as the surface.
    GLES20.glViewport(0, 0, width, height);

    // Create a new perspective projection matrix. The height will stay the
    // same while the width will vary as per aspect ratio.
    final float ratio = (float) width / height;
    final float left = -ratio;
    final float right = ratio;
    final float bottom = -1.0f;
    final float top = 1.0f;
    final float near = 1.0f;
    final float far = 1000.0f;

    Matrix.frustumM(projectionMatrix, 0, left, right, bottom, top, near, far);
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:18,代码来源:LessonEightRenderer.java

示例9: initProjectionMatrix

import android.opengl.Matrix; //导入方法依赖的package包/类
public void initProjectionMatrix(int width, int height) {

        // Set the OpenGL viewport to the same size as the surface
        GLES20.glViewport(0, 0, width, height);

        // Create a new perspective projection matrix.
        // while the width will vary as per aspect ratio.
        final float ratio = (float) width / height;
        final float left = -ratio;
        final float right = ratio;
        final float bottom = -1.0f;
        final float top = 1.0f;
        final float near = 1.0f;
        final float far = 10.0f;

        Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far);
    }
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:18,代码来源:Triangle.java

示例10: gluPerspective

import android.opengl.Matrix; //导入方法依赖的package包/类
public static void gluPerspective(float[] m,
                                  float angle,float aspect,float near,float far) {
    float top=near*(float)Math.tan(angle*(Math.PI/360.0));
    float bottom=-top;
    float left=bottom*aspect;
    float right=top*aspect;
    float[] frustumM=new float[16];
    float[] resultM=new float[16];
    Matrix.frustumM(frustumM,0,left,right,bottom,top,near,far);
    Matrix.multiplyMM(resultM,0,m,0,frustumM,0);
    System.arraycopy(resultM,0,m,0,16);
}
 
开发者ID:jphacks,项目名称:TK_1701,代码行数:13,代码来源:GLES.java

示例11: onSurfaceChanged

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

    float ratio = (float) width / height;

    Matrix.frustumM(projectionMatrix, 0, -ratio, ratio, -1, 1, 3, 7);
}
 
开发者ID:FreeSunny,项目名称:Amazing,代码行数:9,代码来源:MyRender.java

示例12: 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.frustumM(mProjectionMatrix, 0, -ratio * 2, ratio * 2, -2, 2, 2, 7);
}
 
开发者ID:PacktPublishing,项目名称:Building-Android-UIs-with-Custom-Views,代码行数:8,代码来源:GLDrawer.java

示例13: GraphGLRenderer

import android.opengl.Matrix; //导入方法依赖的package包/类
/** Create a renderer that draws a given duration of time. */
public GraphGLRenderer(Context ctx, int durationSec) {
  this.ctx = ctx;
  this.durationSec = durationSec;

  // Set up the view matrix, projection, then combine to make MVP matrix
  float[] mViewMatrix = new float[16];
  float[] mProjectionMatrix = new float[16];
  Matrix.setLookAtM(mViewMatrix, 0, 0, 0, -3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
  Matrix.frustumM(mProjectionMatrix, 0, -1, 1, -1, 1, 3, 7);
  Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mViewMatrix, 0);
}
 
开发者ID:padster,项目名称:Muse-EEG-Toolkit,代码行数:13,代码来源:GraphGLRenderer.java

示例14: surfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
public void surfaceChanged(int width, int height) {
	mWidth = width;
	mHeight = height;
	
    // Adjust the viewport based on geometry changes,
    // such as screen rotation
    GLES20.glViewport(0, 0, width, height);

    float ratio = (float) width / height;

    // this projection matrix is applied to object coordinates
    // in the onDrawFrame() method
    Matrix.frustumM(mProjectionMatrix, 0, -ratio, ratio, -1, 1, 3, 7);

}
 
开发者ID:livio,项目名称:sdl_video_streaming_android_sample,代码行数:16,代码来源:TextureRender.java

示例15: onSurfaceChanged

import android.opengl.Matrix; //导入方法依赖的package包/类
public void onSurfaceChanged(GL10 glUnused, int width, int height) {
    // Ignore the passed-in GL10 interface, and use the GLES20
    // class's static methods instead.
    GLES20.glViewport(0, 0, width, height);
    float ratio = (float) width / height;
    Matrix.frustumM(mProjMatrix, 0, -ratio, ratio, -1, 1, 3, 7);
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:8,代码来源:GLES20TriangleRenderer.java


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