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


Java GL2.glPolygonMode方法代码示例

本文整理汇总了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();
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:23,代码来源:CylinderExample.java

示例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();
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:26,代码来源:PyramidExample.java

示例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();
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:23,代码来源:CubeExample.java

示例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();
}
 
开发者ID:Harium,项目名称:propan-jogl-examples,代码行数:23,代码来源:SphereExample.java


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