本文整理汇总了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);
}
示例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);
}
示例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);
}