List of usage examples for org.lwjgl.opengl GL11 glCullFace
public static void glCullFace(@NativeType("GLenum") int mode)
From source file:org.terasology.rendering.opengl.GraphicState.java
License:Apache License
/** * Resets the state after the rendering of the Reflected Scene. * See preRenderSetupReflectedScene() for some more information. *//*from ww w .ja v a2 s .c o m*/ public void postRenderCleanupReflectedScene() { GL11.glCullFace(GL11.GL_BACK); bindDisplay(); setViewportToWholeDisplay(); }
From source file:org.voxels.platform.LWJGLOpenGLAdapter.java
License:Open Source License
@Override public void glCullFace(final int mode) { GL11.glCullFace(mode); }
From source file:playn.java.JavaGL20.java
License:Apache License
@Override public void glCullFace(int mode) { GL11.glCullFace(mode); }
From source file:processing.opengl.PLWJGL.java
License:Open Source License
@Override public void cullFace(int mode) { GL11.glCullFace(mode); }
From source file:RediscoveredMod.ModelRedDragon.java
License:Open Source License
/** * Sets the models various rotation angles then renders the model. *//*from ww w.jav a 2s . co m*/ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { GL11.glPushMatrix(); EntityGoodDragon var8 = (EntityGoodDragon) par1Entity; float var9 = var8.prevAnimTime + (var8.animTime - var8.prevAnimTime) * this.partialTicks; this.jaw.rotateAngleX = (float) (Math.sin((double) (var9 * (float) Math.PI * 2.0F)) + 1.0D) * 0.2F; float var10 = (float) (Math.sin((double) (var9 * (float) Math.PI * 2.0F - 1.0F)) + 1.0D); var10 = (var10 * var10 * 1.0F + var10 * 2.0F) * 0.05F; GL11.glTranslatef(0.0F, var10 - 2.0F, -3.0F); GL11.glRotatef(var10 * 2.0F, 1.0F, 0.0F, 0.0F); float var11 = -30.0F; float var13 = 0.0F; float var14 = 1.5F; double[] var15 = var8.getMovementOffsets(6, this.partialTicks); float var16 = this.updateRotations(var8.getMovementOffsets(5, this.partialTicks)[0] - var8.getMovementOffsets(10, this.partialTicks)[0]); float var17 = this .updateRotations(var8.getMovementOffsets(5, this.partialTicks)[0] + (double) (var16 / 2.0F)); var11 += 2.0F; float var18 = var9 * (float) Math.PI * 2.0F; var11 = 20.0F; float var12 = -12.0F; float var21; for (int var19 = 0; var19 < 5; ++var19) { double[] var20 = var8.getMovementOffsets(5 - var19, this.partialTicks); var21 = (float) Math.cos((double) ((float) var19 * 0.45F + var18)) * 0.15F; this.neck.rotateAngleY = this.updateRotations(var20[0] - var15[0]) * (float) Math.PI / 180.0F * var14; this.neck.rotateAngleX = var21 + (float) (var20[1] - var15[1]) * (float) Math.PI / 180.0F * var14 * 5.0F; this.neck.rotateAngleZ = -this.updateRotations(var20[0] - (double) var17) * (float) Math.PI / 180.0F * var14; this.neck.rotationPointY = var11; this.neck.rotationPointZ = var12; this.neck.rotationPointX = var13; var11 = (float) ((double) var11 + Math.sin((double) this.neck.rotateAngleX) * 10.0D); var12 = (float) ((double) var12 - Math.cos((double) this.neck.rotateAngleY) * Math.cos((double) this.neck.rotateAngleX) * 10.0D); var13 = (float) ((double) var13 - Math.sin((double) this.neck.rotateAngleY) * Math.cos((double) this.neck.rotateAngleX) * 10.0D); this.neck.render(par7); } this.head.rotationPointY = var11; this.head.rotationPointZ = var12; this.head.rotationPointX = var13; double[] var23 = var8.getMovementOffsets(0, this.partialTicks); this.head.rotateAngleY = this.updateRotations(var23[0] - var15[0]) * (float) Math.PI / 180.0F * 1.0F; this.head.rotateAngleZ = -this.updateRotations(var23[0] - (double) var17) * (float) Math.PI / 180.0F * 1.0F; this.head.render(par7); GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 1.0F, 0.0F); GL11.glRotatef(-var16 * var14 * 1.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, -1.0F, 0.0F); this.body.rotateAngleZ = 0.0F; this.body.render(par7); for (int var22 = 0; var22 < 2; ++var22) { GL11.glEnable(GL11.GL_CULL_FACE); var21 = var9 * (float) Math.PI * 2.0F; this.wing.rotateAngleX = 0.125F - (float) Math.cos((double) var21) * 0.2F; this.wing.rotateAngleY = 0.25F; this.wing.rotateAngleZ = (float) (Math.sin((double) var21) + 0.125D) * 0.8F; this.wingTip.rotateAngleZ = -((float) (Math.sin((double) (var21 + 2.0F)) + 0.5D)) * 0.75F; this.rearLeg.rotateAngleX = 1.0F + var10 * 0.1F; this.rearLegTip.rotateAngleX = 0.5F + var10 * 0.1F; this.rearFoot.rotateAngleX = 0.75F + var10 * 0.1F; this.frontLeg.rotateAngleX = 1.3F + var10 * 0.1F; this.frontLegTip.rotateAngleX = -0.5F - var10 * 0.1F; this.frontFoot.rotateAngleX = 0.75F + var10 * 0.1F; this.wing.render(par7); this.frontLeg.render(par7); this.rearLeg.render(par7); GL11.glScalef(-1.0F, 1.0F, 1.0F); if (var22 == 0) { GL11.glCullFace(GL11.GL_FRONT); } } GL11.glPopMatrix(); GL11.glCullFace(GL11.GL_BACK); GL11.glDisable(GL11.GL_CULL_FACE); float var24 = -((float) Math.sin((double) (var9 * (float) Math.PI * 2.0F))) * 0.0F; var18 = var9 * (float) Math.PI * 2.0F; var11 = 10.0F; var12 = 60.0F; var13 = 0.0F; var15 = var8.getMovementOffsets(11, this.partialTicks); for (int var25 = 0; var25 < 12; ++var25) { var23 = var8.getMovementOffsets(12 + var25, this.partialTicks); var24 = (float) ((double) var24 + Math.sin((double) ((float) var25 * 0.45F + var18)) * 0.05000000074505806D); this.neck.rotateAngleY = (this.updateRotations(var23[0] - var15[0]) * var14 + 180.0F) * (float) Math.PI / 180.0F; this.neck.rotateAngleX = var24 + (float) (var23[1] - var15[1]) * (float) Math.PI / 180.0F * var14 * 5.0F; this.neck.rotateAngleZ = this.updateRotations(var23[0] - (double) var17) * (float) Math.PI / 180.0F * var14; this.neck.rotationPointY = var11; this.neck.rotationPointZ = var12; this.neck.rotationPointX = var13; var11 = (float) ((double) var11 + Math.sin((double) this.neck.rotateAngleX) * 10.0D); var12 = (float) ((double) var12 - Math.cos((double) this.neck.rotateAngleY) * Math.cos((double) this.neck.rotateAngleX) * 10.0D); var13 = (float) ((double) var13 - Math.sin((double) this.neck.rotateAngleY) * Math.cos((double) this.neck.rotateAngleX) * 10.0D); this.neck.render(par7); } GL11.glPopMatrix(); }
From source file:src.graphics.common.Rendering.java
License:Open Source License
/** A generalised interface for stuff that wants to be rendered- *///from w w w. j a v a2 s .c o m void initSettings() { GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHT0); GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); GL11.glEnable(GL11.GL_NORMALIZE); // IF MISSING, COLOURS ARE TOO BRIGHT. GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glCullFace(GL11.GL_BACK); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f); GL11.glEnable(GL11.GL_COLOR_MATERIAL); GL11.glColorMaterial(GL11.GL_FRONT_AND_BACK, GL11.GL_AMBIENT_AND_DIFFUSE); }
From source file:tectonicus.rasteriser.lwjgl.LwjglRasteriser.java
License:BSD License
@Override public void resetState() { GL11.glColorMask(true, true, true, true); GL11.glDepthFunc(GL11.GL_LEQUAL);//from ww w. j a v a2 s .c o m GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glCullFace(GL11.GL_BACK); GL11.glFrontFace(GL11.GL_CW); GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); }
From source file:tk.ivybits.engine.gl.GL.java
License:Open Source License
public static void glCullFace(int a) { GL11.glCullFace(a); }
From source file:uk.co.ifs_studios.engine.util.OpenGL.java
License:Open Source License
/** * Setup OpenGL.//from w ww . j a va2 s.com * * @param width * - Width of screen. * @param height * - Height of screen. */ public static void initialize(int width, int height) { GL11.glClearColor(0f, 0f, 0f, 0f); GL11.glViewport(0, 0, width, height); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glCullFace(GL11.GL_BACK); }