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


Java GL10.glOrthof方法代码示例

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


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

示例1: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //导入方法依赖的package包/类
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
    mRenderListener.onSurfaceChanged(gl, width, height);

    mEngine.setUpScene();
    if (mEngine.isCameraActive() && mEngine.getCamera() != null)
        mEngine.getCamera().update(width, height);


    // Sets the current view port to the new size.
    gl.glViewport(0, 0, width, height);
    // Select the projection matrix
    gl.glMatrixMode(GL10.GL_PROJECTION);
    // Reset the projection matrix
    gl.glLoadIdentity();
    // Select the modelview matrix
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    // Reset the modelview matrix

    gl.glOrthof(0, width, height, 0, 0, 1f);
}
 
开发者ID:ondramisar,项目名称:AdronEngine,代码行数:22,代码来源:AdrGlRenderer.java

示例2: drawFadeVeil

import javax.microedition.khronos.opengles.GL10; //导入方法依赖的package包/类
private void drawFadeVeil(GL10 gl, float alpha) {
       gl.glMatrixMode(GL10.GL_PROJECTION);
       gl.glPushMatrix();

       // orthographic projection is easier to place a 2D object where I want on the screen...
       gl.glLoadIdentity();
       gl.glOrthof( 0, mWidth, 0, mHeight, -10, 10);

       // Allocate object if not done yet
       if (mFadeVeil==null) {
           mFadeVeil = new FadeOutVeil(mWidth,mHeight);
           mFadeVeil.setPosition(mWidth/2, -mHeight/2, 0f);
       }
       mFadeVeil.draw(gl, alpha);

       gl.glPopMatrix();
       gl.glMatrixMode(GL_MODELVIEW);
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:19,代码来源:CoverRollLayout.java

示例3: drawTopFadeOutBand

import javax.microedition.khronos.opengles.GL10; //导入方法依赖的package包/类
private void drawTopFadeOutBand(GL10 gl) {
       gl.glMatrixMode(GL10.GL_PROJECTION);
       gl.glPushMatrix();

       // orthographic projection is easier to place a 2D object where I want on the screen...
       gl.glLoadIdentity();
       gl.glOrthof( 0, mWidth, 0, mHeight, -10, 10);

       // Allocate object if not done yet
       if (mFadeOutBand==null) {
           mFadeOutBand = new FadeOutBand(mWidth,FADEOUTBAND_HEIGHT);
           mFadeOutBand.setPosition(mWidth/2, -(mHeight-FADEOUTBAND_HEIGHT/2), 0f);
       }
       mFadeOutBand.draw(gl);

       gl.glPopMatrix();
       gl.glMatrixMode(GL_MODELVIEW);
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:19,代码来源:CoverRollLayout.java

示例4: draw

import javax.microedition.khronos.opengles.GL10; //导入方法依赖的package包/类
@Override
public void draw(GL10 gl) {
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadIdentity();
    gl.glOrthof(camLeft, camRight, camTop, camBottom, -1, 1);
}
 
开发者ID:ondramisar,项目名称:AdronEngine,代码行数:9,代码来源:Camera.java

示例5: onSurfaceChanged

import javax.microedition.khronos.opengles.GL10; //导入方法依赖的package包/类
@Override
public void onSurfaceChanged(GL10 gl, int width, int height) {
    if (height == 0) height = 1;
    float aspect = (float) width / height;

    gl.glViewport(0, 0, width, height);
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glOrthof(-10.f, 10.f, 10.f / aspect, -10.f / aspect, 0.1f, 100.f);

    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadIdentity();

}
 
开发者ID:PacktPublishing,项目名称:Building-Android-UIs-with-Custom-Views,代码行数:15,代码来源:GLDrawerES1.java

示例6: drawMessageBox

import javax.microedition.khronos.opengles.GL10; //导入方法依赖的package包/类
protected void drawMessageBox(GL10 gl) {
	if (mMessageBox!=null) {

		gl.glMatrixMode(GL10.GL_PROJECTION);
		gl.glPushMatrix();

		// orthographic projection is easier to place a 2D object where I want on the screen...
		gl.glLoadIdentity();
		gl.glOrthof( 0, mWidth, 0, mHeight, -10, 10);

		// Center horizontally, bottom vertically (y sign is weird, linked to glOrthof above, but in a way I didn't figure out)
		mMessageBox.setPosition(mWidth/2, -mHeight/2, 0f);

		// Translation animation
		float[] labelTranslation = null;
		synchronized (mTranslationLock) {
			if (mTranslationXyz != null) {
				labelTranslation = new float[3];
				labelTranslation[0] = mTranslationXyz[0]*mWidth/2; // MAGICAL
				labelTranslation[1] = 0f; // don't slide label vertically
				labelTranslation[2] = 0f; // don't slide label in z
			}
		}
		//scrolling animation
		if (mGLobalLabelScroll!=0f) {
			if (labelTranslation == null) {
				labelTranslation = new float[] {mGLobalLabelScroll,0f,0f};
			} else {
				labelTranslation[0] += mGLobalLabelScroll;
			}
		}

		if (mDrawFocus) {
			mMessageBox.drawFocus(gl, labelTranslation);
		} else {
			mMessageBox.draw(gl, mMessageBoxAlpha, labelTranslation);
		}

		gl.glPopMatrix();
	}
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:42,代码来源:CoverLayout.java


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