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


Java GLU.gluDeleteQuadric方法代码示例

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


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

示例1: drawSphere

import javax.media.opengl.glu.GLU; //导入方法依赖的package包/类
public static void drawSphere(GL2 gl2, double radius, boolean texture) {
	GLU glu = new GLU();
    GLUquadric quadric = glu.gluNewQuadric();
    glu.gluQuadricTexture(quadric, texture);
    if (texture == false) {
    	glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL);
    }
    glu.gluQuadricNormals(quadric, GLU.GLU_FLAT);
    glu.gluQuadricOrientation(quadric, GLU.GLU_OUTSIDE);
    glu.gluSphere(quadric, radius, 64, 64);
    glu.gluDeleteQuadric(quadric);
}
 
开发者ID:momega,项目名称:spacesimulator,代码行数:13,代码来源:GLUtils.java

示例2: render

import javax.media.opengl.glu.GLU; //导入方法依赖的package包/类
public void render(RendererState rendererState) {

		GL gl = rendererState.getGL();
		GLU glu = new GLU();
		
		gl.glRotated(90, 1, 0, 0);
		
		gl.glColor4d(
				material.getColor().getRed(),
				material.getColor().getGreen(),
				material.getColor().getBlue(),
				material.getColor().getAlpha());
		
		Texture texture = null;
		
		if(material.getTexture() != null) {
			
			texture = 
					rendererState.
					getTextureLoader().
					getTexture(
							material.getTexture());
		}
	
		if(texture != null)
			texture.enable();
		
		GLUquadric sphere = glu.gluNewQuadric();
		
		glu.gluQuadricTexture(sphere, true);
		
		glu.gluQuadricDrawStyle(sphere, GLU.GLU_FILL);
		glu.gluQuadricNormals(sphere, GLU.GLU_FLAT);
		glu.gluQuadricOrientation(sphere, GLU.GLU_OUTSIDE);
		
		glu.gluSphere(
				sphere,
				rendererState.getScale().getMagnitude(),
				slices,
				stacks);
		
		glu.gluDeleteQuadric(sphere);
		
		if(texture != null)
			texture.disable();
		
		gl.glColor4d(1, 1, 1, 1);
		
		gl.glRotated(90, -1, 0, 0);
	}
 
开发者ID:Library-of-Kaeon,项目名称:Library-of-Kaeon,代码行数:51,代码来源:Sphere.java

示例3: draw

import javax.media.opengl.glu.GLU; //导入方法依赖的package包/类
/**
 * Draw all locations
 * @param gl
 * @param glu
 * @param shearX
 * @param shearY 
 */
public void draw(GL gl1, GLU glu, double shearX, double shearY) {

    //System.out.println("\ndrawing spheres");

    GL2 gl = (GL2)gl1;
    gl.glInitNames();
    gl.glPushName(0);

    GLUquadric quadric = glu.gluNewQuadric();
    glu.gluQuadricNormals(quadric, GLU.GLU_SMOOTH);

    // store initial drawing color
    gl.glPushAttrib(GL2.GL_CURRENT_BIT);

    for (int i = 0; i < locs.size(); i++) {
        Location loc = locs.get(i);
        gl.glLoadName(i);
        gl.glColor4f(loc.r, loc.g, loc.b, 1.0f);
        gl.glPushMatrix();
        try {
            double x = loc.x;
            double y = loc.y;
            double z = grid.z(x, y);
            x += shearX * z;
            y += shearY * z;
            //System.out.println("ID " + i + "\t" + x + "\t" + y + "\t" + z);
            gl.glTranslated(x, y, z);
            glu.gluSphere(quadric, R, LONGITUDE_SLICES, LATITUDE_SLICES);
        } catch (Exception exc) {
            // FIXME
            System.out.println("Could not draw sphere");                
        }
        gl.glPopMatrix();
    }

    // restore initial drawing color
    gl.glPopAttrib();

    glu.gluDeleteQuadric(quadric);
}
 
开发者ID:OSUCartography,项目名称:TerrainViewer,代码行数:48,代码来源:Spheres.java


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