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