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


Java GLU.gluNewQuadric方法代碼示例

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


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

示例1: VertexRenderer

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public VertexRenderer(GLAutoDrawable drawable,
		NetworkRenderer networkRenderer) {
	super(drawable, networkRenderer);
	this.DLIST_DISK = getDisplayListIndex(Constants.SHAPE_DISK);
	this.DLIST_SQUARE = getDisplayListIndex(Constants.SHAPE_SQUARE);

	glu = new GLU();
	quadric = glu.gluNewQuadric();

	// Display List initialization
	gl.glNewList(DLIST_DISK, GL2.GL_COMPILE);
	glu.gluDisk(quadric, 0, 1, DISK_SLICES, DISK_RINGS);
	gl.glEndList();

	gl.glNewList(DLIST_SQUARE, GL2.GL_COMPILE);
	gl.glRectd(-1, -1, 1, 1);
	gl.glEndList();
}
 
開發者ID:dev-cuttlefish,項目名稱:cuttlefish,代碼行數:19,代碼來源:VertexRenderer.java

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

示例3: PictureFrame

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public PictureFrame(GL2 gl, GLU glu, Point3d s) {
    quadric = glu.gluNewQuadric();
    glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL); // GLU_POINT, GLU_LINE, GLU_FILL, GLU_SILHOUETTE
    glu.gluQuadricNormals  (quadric, GLU.GLU_NONE); // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
    glu.gluQuadricTexture  (quadric, false);        // use true to generate texture coordinates

    sphereQuadric = glu.gluNewQuadric();
    glu.gluQuadricDrawStyle(sphereQuadric, GLU.GLU_FILL);
    glu.gluQuadricNormals  (sphereQuadric, GLU.GLU_NONE);
    glu.gluQuadricTexture  (sphereQuadric, true); // for Signorile's head

    photoTexture     = Building.setupTexture(gl, "texturepicture.gif"); 

    frameHeight = 8;
    frameWidth = 11;
    start = new Point3d(s.getX(),s.getY(),s.getZ());
}
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:18,代碼來源:PictureFrame.java

示例4: LiptonBuilding

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public LiptonBuilding(GL2 gl, GLU glu) {
	wallTexture = setupTexture(gl, "LiptonWall.gif");
       brickTexture = setupTexture(gl, "LiptonBrick.jpg"); 
       floorTexture = setupTexture(gl, "LiptonFloor.jpg"); 
	grassTexture = setupTexture(gl, "LiptonGrass.jpg");
	brick2Texture = setupTexture(gl, "LiptonBrickBack.jpg"); 
	doorTexture = setupTexture(gl, "LiptonTable.gif"); 
	waterTexture = setupTexture(gl, "LiptonWater.gif"); 
	bridgeTexture = setupTexture(gl, "LiptonBridge.jpg"); 
	
	furniture = new LiptonFurniture(gl, glu);
       
	quadric = glu.gluNewQuadric();
       glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL); // GLU_POINT, GLU_LINE, GLU_FILL, GLU_SILHOUETTE
       glu.gluQuadricNormals  (quadric, GLU.GLU_NONE); // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
       glu.gluQuadricTexture  (quadric, true);        // false, or true to generate texture coordinates
}
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:18,代碼來源:LiptonBuilding.java

示例5: Critter

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
protected Critter(float x,float y,float z,float a,float s,float tR, GL2 gl, GLU glu){
	this.x=x;this.y=y;this.z=z;
	a=a%360;
	if(a<0)a+=360;
	tAngle=angle=a;
	speed=s;tRate=tR;
	
	textureQuadric = glu.gluNewQuadric();
       glu.gluQuadricDrawStyle(textureQuadric, GLU.GLU_FILL); // GLU_POINT, GLU_LINE, GLU_FILL, GLU_SILHOUETTE
       glu.gluQuadricNormals  (textureQuadric, GLU.GLU_NONE); // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
       glu.gluQuadricTexture  (textureQuadric, true);        // use true to generate texture coordinates
       
       quadric = glu.gluNewQuadric();
       glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL);
       glu.gluQuadricNormals  (quadric, GLU.GLU_NONE);
       glu.gluQuadricTexture  (quadric, false);
       
       Projectile.registerWeaponWatcher(this);
}
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:20,代碼來源:Critter.java

示例6: OConnorFloatingLight

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public OConnorFloatingLight(float x, float y, float z, float size, float speed, float radX, float radY, float radZ, GL2 gl, GLU glu) {
	GLUquadric quadric = glu.gluNewQuadric();
	glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL);
	glu.gluQuadricNormals(quadric, GLU.GLU_FLAT);
	glu.gluQuadricTexture  (quadric, false);
	this.quadric = quadric;
	this.x = x;
	this.y = y;
	this.z = z;
	this.size = size;
	this.flightRadiusX = radX;
	this.flightRadiusY = radY;
	this.flightRadiusZ = radZ;
	this.speed = speed;
	this.colorChange = (int)(Math.random()*100);
	this.posChange = (float)(Math.random()*100);
	this.r = (float)Math.random();
	this.g = (float)Math.random();
	this.b = (float)Math.random();
}
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:21,代碼來源:OConnorFloatingLight.java

示例7: XiangBuilding

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public XiangBuilding(GL2 gl, GLU glu) {
 super();
    quadric = glu.gluNewQuadric();
    glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL); // GLU_POINT, GLU_LINE, GLU_FILL, GLU_SILHOUETTE
    glu.gluQuadricNormals  (quadric, GLU.GLU_NONE); // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
    glu.gluQuadricTexture  (quadric, false);        // use true to generate texture coordinates

    sphereQuadric = glu.gluNewQuadric();
    glu.gluQuadricDrawStyle(sphereQuadric, GLU.GLU_FILL);
    glu.gluQuadricNormals  (sphereQuadric, GLU.GLU_NONE);
    glu.gluQuadricTexture  (sphereQuadric, true); // for Signorile's head
    
    brickTexture = setupTexture(gl, "XiangBricks.jpg");
    groundfloorTexture = setupTexture(gl, "XiangFloor.jpg");
    triangleTexture     = setupTexture(gl, "XiangRoof.jpg"); 
    homefloorTexture = setupTexture(gl,"XiangHomeFloor.jpg");
    lampTexture = setupTexture(gl,"XiangLamp.jpg");
    ballTexture = setupTexture(gl, "XiangBall.jpg");
    basketballTexture = setupTexture(gl, "XiangBasketball.jpg");
    insideWallTexture = setupTexture(gl, "XiangWall.jpg");
    // png's don't seem to work any more
}
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:23,代碼來源:XiangBuilding.java

示例8: LiptonFurniture

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public LiptonFurniture(GL2 gl, GLU glu){
	carpetTexture = setupTexture(gl, "LiptonCarpet.jpg");
	tableTexture = setupTexture(gl, "LiptonTable.gif");
	hatTexture = setupTexture(gl, "LiptonPink.jpg");
	paintingTexture = setupTexture(gl, "LiptonPaint1.jpg");
	painting2Texture = setupTexture(gl, "LiptonPaint2.jpg");
	painting3Texture = setupTexture(gl, "LiptonPaint3.jpg");
	painting4Texture = setupTexture(gl, "LiptonPaint4.jpg");
	chessTexture = setupTexture(gl, "LiptonChess.jpg");
	bookTexture = setupTexture(gl, "LiptonBooks.jpg");
	
	quadric = glu.gluNewQuadric();
       glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL); // GLU_POINT, GLU_LINE, GLU_FILL, GLU_SILHOUETTE
       glu.gluQuadricNormals  (quadric, GLU.GLU_NONE); // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
       glu.gluQuadricTexture  (quadric, true);        // false, or true to generate texture coordinates
}
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:17,代碼來源:LiptonFurniture.java

示例9: Mummy

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public Mummy(float x, float z, GL2 gl, GLU glu){
	eyeVecX = 0.2;
	eyeVecZ = 0.2;
	spawnx = x;
	spawny = 0;
	spawnz = z;
	locx = x;
	locy = 0;
	locz = z;
	
	bodyTexture = Building.setupTexture(gl, "liangmummy.jpg");
	bodyQuadric = glu.gluNewQuadric();
       glu.gluQuadricDrawStyle(bodyQuadric, GLU.GLU_FILL); // GLU_POINT, GLU_LINE, GLU_FILL, GLU_SILHOUETTE
       glu.gluQuadricNormals  (bodyQuadric, GLU.GLU_NONE); // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
       glu.gluQuadricTexture  (bodyQuadric, true);        // false, or true to generate texture coordinates
       agro = false;
       dead = false;
       PlayerMotion.registerPlayerWatcher(this);
       Projectile.registerProjectileWatcher(this);
	
}
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:22,代碼來源:Mummy.java

示例10: VallejoBuilding

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public VallejoBuilding(GL2 gl, GLU glu){
	quadric = glu.gluNewQuadric();
       glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL); // GLU_POINT, GLU_LINE, GLU_FILL, GLU_SILHOUETTE
       glu.gluQuadricNormals  (quadric, GLU.GLU_NONE); // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
       glu.gluQuadricTexture  (quadric, true);        // false, or true to generate texture coordinates
   
       ballTexture = setupTexture(gl, "Vallejoball.jpg");
       grassTexture = setupTexture(gl, "Vallejorock.gif");
       brickTexture = setupTexture(gl, "Vallejobrick041.jpg");
       insideWall = setupTexture(gl, "Vallejobeige005.jpg");
       floorTexture = setupTexture(gl, "Vallejofield.jpg");
       ceilingTexture = setupTexture(gl, "Vallejobeige015.jpg");
       goalTexture = setupTexture(gl, "Vallejogoal.gif");
       doorTexture = setupTexture(gl, "Vallejodoor.jpg");
       ceilingTexture = setupTexture(gl, "Vallejoroof.jpg");
}
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:17,代碼來源:VallejoBuilding.java

示例11: OConnorHangingLight

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public OConnorHangingLight(float x, float yCeiling, float z, float size, float length, GL2 gl, GLU glu) {
	GLUquadric quadric = glu.gluNewQuadric();
	glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL);
	glu.gluQuadricNormals(quadric, GLU.GLU_FLAT);
	glu.gluQuadricTexture  (quadric, false);
	this.quadric = quadric;
	this.x = x;
	this.y = yCeiling;
	this.z = z;
	this.length = length;
	this.size = size;
	this.colorChange = (int)(Math.random()*100);
	this.bobChange = (float)(Math.random()*100);
	this.r = (float)Math.random();
	this.g = (float)Math.random();
	this.b = (float)Math.random();
}
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:18,代碼來源:OConnorHangingLight.java

示例12: MidgleyBuilding

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public MidgleyBuilding(GL2 gl, GLU glu){

	    	   grass = setupTexture(gl, "MidgleyGrass.jpg");
	    	   paneling = setupTexture(gl, "MidgleyPanelWood.jpg");
	           wallpaper  = setupTexture(gl, "MidgleyWallpaper.jpg"); // if this causes trouble, try bricks.gif
	           bricks = setupTexture(gl, "MidgleyBricks.jpg");
	           carpet  = setupTexture(gl, "MidgleyCarpet.jpg"); // if this causes trouble, try bricks.gif
	           shingles = setupTexture(gl, "MidgleyShingles2.jpg");
	           chestwood  = setupTexture(gl, "MidgleyChestWood.gif"); // if this causes trouble, try bricks.gif
	           chestwoodTop  = setupTexture(gl, "MidgleyChestWoodTop.gif"); // if this causes trouble, try bricks.gif
	           marble = setupTexture(gl, "MidgleyMantleMarble.gif");
	           //cross  = setupTexture(gl, "MidgleyCross.gif"); // if this causes trouble, try bricks.gif
	           
	           quadric = glu.gluNewQuadric();
	           glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL); // GLU_POINT, GLU_LINE, GLU_FILL, GLU_SILHOUETTE
	           glu.gluQuadricNormals  (quadric, GLU.GLU_NONE); // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
	           glu.gluQuadricTexture  (quadric, true);        // true to generate texture coordinates

	       }
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:20,代碼來源:MidgleyBuilding.java

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

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

示例15: Fire

import javax.media.opengl.glu.GLU; //導入方法依賴的package包/類
public Fire(double x, double y, double z, double angle, GL2 gl, GLU glu){

		quadric = glu.gluNewQuadric();
		
		glu.gluQuadricDrawStyle(quadric, GLU.GLU_FILL); // GLU_POINT, GLU_LINE, GLU_FILL, GLU_SILHOUETTE
		glu.gluQuadricNormals  (quadric, GLU.GLU_NONE); // GLU_NONE, GLU_FLAT, or GLU_SMOOTH
		glu.gluQuadricTexture  (quadric, true);        // false, or true to generate texture coordinates

		// Load in Textures Below
		fire[0] = Building.setupTexture(gl, "DragonTextures/fire1.png");
		for(int i=1; i< 23; i++){
			fire[i] = Building.setupTexture(gl, "DragonTextures/fire" + (i+1) + ".png");
		}
		
		this.lx = x;
		this.ly = y;
		this.lz = z;
		
		fireAngle = (-1 * Math.random() * 70) - 10;
		eyeAngle = angle;
		
		dx = Math.cos(eyeAngle);
		dy = Math.sin(Math.toRadians(fireAngle));
		dz = Math.sin(eyeAngle);
		
		System.out.println("Eye Angle: " + eyeAngle);
	}
 
開發者ID:ProfAmesBC,項目名稱:Game2013,代碼行數:28,代碼來源:Fire.java


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