List of usage examples for org.lwjgl.opengl GL11 glRotatef
public static native void glRotatef(@NativeType("GLfloat") float angle, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z);
From source file:com.shinoow.abyssalcraft.client.render.item.RenderHilt.java
License:Apache License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED) { GL11.glPushMatrix();/* w w w. ja v a2 s.c o m*/ FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource); GL11.glRotatef(90F, 1.0F, 1.0F, -0.5F); if (type == ItemRenderType.EQUIPPED) GL11.glTranslatef(0.75F, -0.1F, 0.1F); else GL11.glTranslatef(0.61F, 0.0F, 0.0F); float scale = 1.1F; GL11.glScalef(scale, scale, scale); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } if (type == ItemRenderType.ENTITY) { GL11.glPushMatrix(); float scale = 1.5F; GL11.glScalef(scale, scale, scale); FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource); GL11.glRotatef(0F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(90F, 0.0f, 1.0f, 0.0f); GL11.glRotatef(90F, 0.0f, 0.0f, 1.0f); GL11.glTranslatef(0.5F, -0.5F, 0.1F); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } if (type == ItemRenderType.INVENTORY) { GL11.glPushMatrix(); float scale = 1.0F; GL11.glScalef(scale, scale, scale); FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource); GL11.glRotatef(80F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(-80F, 0.0f, 1.0f, 0.0f); GL11.glTranslatef(0.2F, 0.0F, -0.2F); model.render(0.0625F); GL11.glPopMatrix(); } }
From source file:com.shinoow.abyssalcraft.client.render.item.RenderStaff.java
License:Apache License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED) { GL11.glPushMatrix();//from w ww. j a v a 2 s .c o m FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource); GL11.glRotatef(170F, 1.0F, 0.4F, -0.5F); if (type == ItemRenderType.EQUIPPED) GL11.glTranslatef(0.41F, -0.4F, -0.55F); else GL11.glTranslatef(0.61F, -0.4F, -0.55F); float scale = 1.1F; GL11.glScalef(scale, scale, scale); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } if (type == ItemRenderType.ENTITY) { GL11.glPushMatrix(); float scale = 1.5F; GL11.glScalef(scale, scale, scale); FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource); GL11.glRotatef(0F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(0F, 0.0f, 1.0f, 0.0f); GL11.glRotatef(90F, 0.0f, 0.0f, 1.0f); GL11.glTranslatef(0.1F, -0.5F, 0.1F); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } if (type == ItemRenderType.INVENTORY) { GL11.glPushMatrix(); float scale = 1.0F; GL11.glScalef(scale, scale, scale); FMLClientHandler.instance().getClient().renderEngine.bindTexture(resource); GL11.glRotatef(80F, 1.0f, 0.0f, 0.0f); GL11.glRotatef(-80F, 0.0f, 1.0f, 0.0f); GL11.glTranslatef(0.0F, 0.0F, 0F); model.render(0.0625F); GL11.glPopMatrix(); } }
From source file:com.sirolf2009.necroapi.NecroEntityQuadruped.java
License:LGPL
@Override public void preRender(Entity entity, BodyPart[] parts, BodyPartLocation location, ModelBase model) { if (entity.getDataWatcher().getWatchableObjectByte(16) == 1 && location == BodyPartLocation.Torso) { GL11.glRotatef(-90, 1, 0, 0); GL11.glTranslatef(0, -0.5F, 1);//from w ww . jav a 2 s . co m } }
From source file:com.smithsmodding.smithscore.util.client.gui.UIRotation.java
/** * Convenient Function to perform this rotation on the GL Buffer Matrix */ public void performGLRotation() { GL11.glRotatef(iAngle, iRotateX, iRotateY, iRotateZ); }
From source file:com.smithsmodding.smithscore.util.client.gui.UIRotation.java
/** * Convenient Function to undo this rotation on the GL Buffer Matrix */ public void performGLRotationReset() { GL11.glRotatef(-iAngle, iRotateX, iRotateY, iRotateZ); }
From source file:com.spawck.hs2.client.renderer.model.ModelSoul.java
License:GNU General Public License
@Override public void render(Entity entity, float par2, float par3, float par4, float par5, float par6, float par7) { GL11.glPushMatrix();// ww w .j ava2 s . c o m GL11.glScalef(1.0F, 1.0F, 1.0F); GL11.glTranslatef(0.0F, -0.5F, 0.0F); if (this.base != null) { this.base.render(par7); } GL11.glEnable(2977); GL11.glEnable(3042); GL11.glBlendFunc(770, 771); GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(0.0F, 0.8F + par4, 0.0F); GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); this.glass.render(par7); float var8 = 0.875F; GL11.glScalef(var8, var8, var8); GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); this.glass.render(par7); GL11.glScalef(var8, var8, var8); GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); this.cube.render(par7); GL11.glDepthFunc(514); GL11.glDisable(2896); GL11.glEnable(3042); GL11.glBlendFunc(768, 1); float var14 = 0.76F; GL11.glColor4f(0.5F * var14, 0.25F * var14, 0.8F * var14, 1.0F); GL11.glMatrixMode(5890); GL11.glPushMatrix(); float var15 = 0.125F; GL11.glScalef(var15, var15, var15); float var16 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; GL11.glTranslatef(var16, 0.0F, 0.0F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); this.cube.render(par7); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(var15, var15, var15); var16 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; GL11.glTranslatef(-var16, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); this.cube.render(par7); GL11.glPopMatrix(); GL11.glMatrixMode(5888); GL11.glDisable(3042); GL11.glEnable(2896); GL11.glDepthFunc(515); GL11.glPopMatrix(); }
From source file:com.sriramramani.droid.inspector.ui.InspectorCanvas.java
License:Mozilla Public License
private void doPaint() { if (isDisposed() || mNode == null) { return;/*from ww w.j a va 2s . c o m*/ } setCurrent(); // Clear the color, depth and stencil buffers. GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT); GL11.glLoadIdentity(); GLU.gluLookAt(0.0f, 0.0f, mCamera.z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); // Transformations happen in the reverse. if (mIsOrtho) { // User's translation. GL11.glTranslatef(mOrthoTranslate.x, mOrthoTranslate.y, 0.0f); // Rotate 180 degrees. GL11.glRotatef(180.0f, 1.0f, 0.0f, 0.0f); // Center the nodes. final Rectangle bounds = getBounds(); final float scaledWidth = mNode.bounds.width * mOrthoScale; final float scaledHeight = mNode.bounds.height * mOrthoScale; GL11.glTranslatef((bounds.width - scaledWidth) / 2, 0.0f, 0.0f); // Scale based on viewport size. GL11.glTranslatef(scaledWidth / 2, -scaledHeight / 2, 0.0f); GL11.glScalef(mOrthoScale, mOrthoScale, 0.0f); GL11.glTranslatef(-scaledWidth / 2, scaledHeight / 2, 0.0f); } else { // Translate all the nodes. GL11.glTranslatef(mTranslate.x, mTranslate.y, 0.0f); // Rotate. GL11.glRotatef(mRotate.x, 1.0f, 0.0f, 0.0f); GL11.glRotatef(mRotate.y, 0.0f, 1.0f, 0.0f); // Center the nodes. GL11.glTranslatef(-mNode.bounds.width / 2, mNode.bounds.height / 2, 0.0f); } final float absX = Math.abs(mRotate.x); final float absY = Math.abs(mRotate.y); mDepth = Math.max(absX, absY) * 5 / 9.0f; drawHierarchy(mNode); if (!mIsPicking && mIsOrtho && mShowOverdraw) { for (int i = 2; i <= 5; i++) { drawOverdraw(i); } } GL11.glFlush(); if (!mIsPicking) { swapBuffers(); } }
From source file:com.stormister.rediscovered.ModelChair.java
License:Open Source License
public void render(float scale, double x, double y, double z, float ang, float angY, boolean renderLantern, boolean lanternOn, boolean renderHeadTorch) { GL11.glPushMatrix();/*from w w w . j a va 2s. c om*/ GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glPushMatrix(); GL11.glRotatef(ang, 1f, 0f, 0f); GL11.glRotatef(angY, 0f, 1f, 0f); back.render(scale); leg1.render(scale); leg2.render(scale); leg3.render(scale); leg4.render(scale); seat.render(scale); GL11.glPopMatrix(); GL11.glPopMatrix(); }
From source file:com.stormister.rediscovered.ModelLockedChest.java
License:Open Source License
public void render(float scale, double x, double y, double z, float ang, float angY, boolean renderLantern, boolean lanternOn, boolean renderHeadTorch) { GL11.glPushMatrix();// w ww . j a v a 2 s . c om GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glPushMatrix(); GL11.glRotatef(ang, 1f, 0f, 0f); GL11.glRotatef(angY, 0f, 1f, 0f); chestBelow.render(scale); chestLid.render(scale); chestKnob.render(scale); GL11.glPopMatrix(); GL11.glPopMatrix(); }
From source file:com.stormister.rediscovered.ModelSpikes.java
License:Open Source License
public void render(float scale, double x, double y, double z, float ang, float angY, boolean renderLantern, boolean lanternOn, boolean renderHeadTorch) { GL11.glPushMatrix();//from w ww. jav a 2 s . c o m GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glPushMatrix(); GL11.glRotatef(ang, 1f, 0f, 0f); GL11.glRotatef(angY, 0f, 1f, 0f); Base.render(scale); Spike1.render(scale); Spike2.render(scale); Spike3.render(scale); Spike4.render(scale); Spike5.render(scale); Spike6.render(scale); Spike7.render(scale); Spike8.render(scale); Spike9.render(scale); Spike10.render(scale); GL11.glPopMatrix(); GL11.glPopMatrix(); }