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