當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。