本文整理汇总了Java中com.jogamp.opengl.GL2.glPolygonMode方法的典型用法代码示例。如果您正苦于以下问题:Java GL2.glPolygonMode方法的具体用法?Java GL2.glPolygonMode怎么用?Java GL2.glPolygonMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL2
的用法示例。
在下文中一共展示了GL2.glPolygonMode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2();
if(wireFrame) {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
} else {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
}
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
//gl.glColor3f(1.0f, 1.0f, 0f);
g.setColor(color);
gl.glLoadIdentity(); /* clear the matrix */
/* viewing transformation */
g.getGLU().gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
gl.glScalef(1.0f, 2.0f, 1.0f); /* modeling transformation */
g.drawCylinder(1, 2);
gl.glFlush();
}
示例2: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2();
if(wireFrame) {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
} else {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
}
angleY += 0.4;
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
//gl.glColor3f(1.0f, 1.0f, 0f);
g.setColor(color);
gl.glLoadIdentity(); /* clear the matrix */
/* viewing transformation */
g.getGLU().gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
gl.glRotated(angleY, 0,1,0);
gl.glScalef(1.0f, 2.0f, 1.0f); /* modeling transformation */
g.drawPyramid(1.0f);
gl.glFlush();
}
示例3: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2();
if(wireFrame) {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
} else {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
}
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
//gl.glColor3f(1.0f, 1.0f, 0f);
g.setColor(color);
gl.glLoadIdentity(); /* clear the matrix */
/* viewing transformation */
g.getGLU().gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
gl.glScalef(1.0f, 2.0f, 1.0f); /* modeling transformation */
g.drawCube(1.0);
gl.glFlush();
}
示例4: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2();
if(wireFrame) {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
} else {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
}
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
//gl.glColor3f(1.0f, 1.0f, 0f);
g.setColor(color);
gl.glLoadIdentity(); /* clear the matrix */
/* viewing transformation */
g.getGLU().gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
gl.glScalef(1.0f, 2.0f, 1.0f); /* modeling transformation */
g.drawSphere(1.0);
gl.glFlush();
}