本文整理汇总了Java中com.jogamp.opengl.glu.GLU.gluOrtho2D方法的典型用法代码示例。如果您正苦于以下问题:Java GLU.gluOrtho2D方法的具体用法?Java GLU.gluOrtho2D怎么用?Java GLU.gluOrtho2D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.glu.GLU
的用法示例。
在下文中一共展示了GLU.gluOrtho2D方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
protected static void setup(GL pGL, int width, int height)
{
pGL.getGL2().glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pGL.getGL2().glLoadIdentity();
// coordinate system origin at lower left with width and height same as
// the
// window
final GLU glu = new GLU();
glu.gluOrtho2D(0.0f, width, 0.0f, height);
pGL.getGL2().glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
pGL.getGL2().glLoadIdentity();
pGL.glViewport(0, 0, width, height);
}
示例2: resizeArea
import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
/**
* Resizes the area.
*
* @param gl2
* The GL object
* @param x
* unused
* @param y
* unused
* @param width
* The width
* @param height
* The hieght
*/
protected void resizeArea(GL2 gl2, int x, int y, int width, int height) {
gl2.glMatrixMode(GL2.GL_PROJECTION);
gl2.glLoadIdentity();
// coordinate system origin at lower left with width and height same as
// the window
GLU glu = new GLU();
glu.gluOrtho2D(0.0f, width, 0.0f, height);
gl2.glMatrixMode(GL2.GL_MODELVIEW);
gl2.glLoadIdentity();
gl2.glViewport(0, 0, width, height);
area.setWidth(width);
area.setHeight(height);
}
示例3: MakeFullScreenQuad
import com.jogamp.opengl.glu.GLU; //导入方法依赖的package包/类
void MakeFullScreenQuad(GL2 gl) {
GLU glu = GLU.createGLU(gl);
g_quadDisplayList = gl.glGenLists(1);
gl.glNewList(g_quadDisplayList, GL2.GL_COMPILE);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glPushMatrix();
gl.glLoadIdentity();
glu.gluOrtho2D(0.0f, 1.0f, 0.0f, 1.0f);
gl.glBegin(GL2.GL_QUADS);
{
gl.glVertex2f(0.0f, 0.0f);
gl.glVertex2f(1.0f, 0.0f);
gl.glVertex2f(1.0f, 1.0f);
gl.glVertex2f(0.0f, 1.0f);
}
gl.glEnd();
gl.glPopMatrix();
gl.glEndList();
}