當前位置: 首頁>>代碼示例>>Java>>正文


Java GLU.gluQuadricOrientation方法代碼示例

本文整理匯總了Java中javax.media.opengl.glu.GLU.gluQuadricOrientation方法的典型用法代碼示例。如果您正苦於以下問題:Java GLU.gluQuadricOrientation方法的具體用法?Java GLU.gluQuadricOrientation怎麽用?Java GLU.gluQuadricOrientation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.media.opengl.glu.GLU的用法示例。


在下文中一共展示了GLU.gluQuadricOrientation方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: gegGLCalList

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
protected void gegGLCalList(){
    GLU glu = new GLU();
    GLUquadric sQuad= glu.gluNewQuadric();
    callist = gl.glGenLists(1);
    gl.glNewList(callist, gl.GL_COMPILE);
    texture.enable(gl);
    texture.bind(gl);
    glu.gluQuadricTexture(sQuad, true);
    glu.gluQuadricOrientation(sQuad, glu.GLU_INSIDE);
    glu.gluSphere(sQuad, radius, 36, 72);
    gl.glEndList();
}
 
開發者ID:seemywingz,項目名稱:Kengine,代碼行數:13,代碼來源:SkyDome.java

示例2: mkGLCallList

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
protected int mkGLCallList(){
    GLU glu = new GLU();
    int callList;

    GLUquadric quad = glu.gluNewQuadric();
    // material properties
    float[] no_mat = {0.0f, 0.0f, 0.0f, 1.0f};
    float[] mat_ambient = {1f, 1f, 1f, 1.0f};
    float[] mat_diffuse = {1, 1, 1, 1.0f};
    float[] mat_specular = {1.0f, 1.0f, 1.0f, 1.0f};
    float no_shininess = 0.0f;
    float low_shininess = 5.0f;
    float high_shininess = 100.0f;
    float[] mat_emission = {0.3f, 0.2f, 0.2f, 0.0f};

    callList = gl.glGenLists(1);
    gl.glNewList(callList, gl.GL_COMPILE);
    gl.glMaterialfv(gl.GL_FRONT, gl.GL_AMBIENT, Utils.mkFloatBuffer(no_mat));
    gl.glMaterialfv(gl.GL_FRONT, gl.GL_DIFFUSE, Utils.mkFloatBuffer(mat_diffuse));
    gl.glMaterialfv(gl.GL_FRONT, gl.GL_SPECULAR, Utils.mkFloatBuffer(mat_specular));
    gl.glMaterialf(gl.GL_FRONT, gl.GL_SHININESS, high_shininess);
    gl.glMaterialfv(gl.GL_FRONT, gl.GL_EMISSION, Utils.mkFloatBuffer(no_mat));
    glu.gluQuadricTexture(quad, true);
    glu.gluQuadricOrientation(quad, glu.GLU_OUTSIDE);
    texture.enable(gl);
    texture.bind(gl);
    glu.gluSphere(quad, 1, 36, 72);
    texture.disable(gl);
    gl.glEndList();
    return callList;
}
 
開發者ID:seemywingz,項目名稱:Kengine,代碼行數:32,代碼來源:Ball.java

示例3: 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

示例4: 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


注:本文中的javax.media.opengl.glu.GLU.gluQuadricOrientation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。