List of usage examples for org.lwjgl.opengl GL11 glVertex3d
public static native void glVertex3d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z);
From source file:com.github.begla.blockmania.rendering.Primitives.java
License:Apache License
/** * @param scaleX Scale along the x-axis * @param scaleY Scale along the y-axis * @param scaleZ Scale along the z-axis * @param x Position on the x-axis * @param y Position on the y-axis * @param z Position on the z-axis * @param drawLeft// ww w .j av a2 s. c om * @param drawRight * @param drawFront * @param drawBack */ public static void drawCloud(double scaleX, double scaleY, double scaleZ, double x, double y, double z, boolean drawLeft, boolean drawRight, boolean drawFront, boolean drawBack) { // Top Face GL11.glColor4f(CLOUD_COLOR_2.x, CLOUD_COLOR_2.y, CLOUD_COLOR_2.z, CLOUD_COLOR_2.w); GL11.glTexCoord2f(0.0f, 0.5f); GL11.glVertex3d(-0.5 * scaleX + x, 0.5 * scaleY + y, -0.5 * scaleZ + z); GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3d(-0.5 * scaleX + x, 0.5 * scaleY + y, 0.5 * scaleZ + z); GL11.glTexCoord2f(0.5f, 0.0f); GL11.glVertex3d(0.5 * scaleX + x, 0.5 * scaleY + y, 0.5 * scaleZ + z); GL11.glTexCoord2f(0.5f, 0.5f); GL11.glVertex3d(0.5 * scaleX + x, 0.5 * scaleY + y, -0.5 * scaleZ + z); // Back Face if (drawBack) { GL11.glColor4f(CLOUD_COLOR_2.x, CLOUD_COLOR_2.y, CLOUD_COLOR_2.z, CLOUD_COLOR_2.w); GL11.glTexCoord2f(0.5f, 0.0f); GL11.glVertex3d(-0.5 * scaleX + x, -0.5 * scaleY + y, -0.5 * scaleZ + z); GL11.glTexCoord2f(0.5f, 0.5f); GL11.glVertex3d(-0.5 * scaleX + x, 0.5 * scaleY + y, -0.5 * scaleZ + z); GL11.glTexCoord2f(0.0f, 0.5f); GL11.glVertex3d(0.5 * scaleX + x, 0.5 * scaleY + y, -0.5 * scaleZ + z); GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3d(0.5 * scaleX + x, -0.5 * scaleY + y, -0.5 * scaleZ + z); } // Left Face if (drawLeft) { GL11.glColor4f(CLOUD_COLOR_2.x, CLOUD_COLOR_2.y, CLOUD_COLOR_2.z, CLOUD_COLOR_2.w); GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3d(-0.5 * scaleX + x, -0.5 * scaleY + y, -0.5 * scaleZ + z); GL11.glTexCoord2f(0.5f, 0.0f); GL11.glVertex3d(-0.5 * scaleX + x, -0.5 * scaleY + y, 0.5 * scaleZ + z); GL11.glTexCoord2f(0.5f, 0.5f); GL11.glVertex3d(-0.5 * scaleX + x, 0.5 * scaleY + y, 0.5 * scaleZ + z); GL11.glTexCoord2f(0.0f, 0.5f); GL11.glVertex3d(-0.5 * scaleX + x, 0.5 * scaleY + y, -0.5 * scaleZ + z); } // Right face if (drawRight) { GL11.glColor4f(CLOUD_COLOR_2.x, CLOUD_COLOR_2.y, CLOUD_COLOR_2.z, CLOUD_COLOR_2.w); GL11.glTexCoord2f(0.5f, 0.0f); GL11.glVertex3d(0.5 * scaleX + x, -0.5 * scaleY + y, -0.5 * scaleZ + z); GL11.glTexCoord2f(0.5f, 0.5f); GL11.glVertex3d(0.5 * scaleX + x, 0.5 * scaleY + y, -0.5 * scaleZ + z); GL11.glTexCoord2f(0.0f, 0.5f); GL11.glVertex3d(0.5 * scaleX + x, 0.5 * scaleY + y, 0.5 * scaleZ + z); GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3d(0.5 * scaleX + x, -0.5 * scaleY + y, 0.5 * scaleZ + z); } // Front face if (drawFront) { GL11.glColor4f(CLOUD_COLOR_2.x, CLOUD_COLOR_2.y, CLOUD_COLOR_2.z, CLOUD_COLOR_2.w); GL11.glTexCoord2f(0.5f, 0.0f); GL11.glVertex3d(-0.5 * scaleX + x, -0.5 * scaleY + y, 0.5 * scaleZ + z); GL11.glTexCoord2f(0.5f, 0.0f); GL11.glVertex3d(0.5 * scaleX + x, -0.5 * scaleY + y, 0.5 * scaleZ + z); GL11.glTexCoord2f(0.5f, 0.5f); GL11.glVertex3d(0.5 * scaleX + x, 0.5 * scaleY + y, 0.5 * scaleZ + z); GL11.glTexCoord2f(0.0f, 0.5f); GL11.glVertex3d(-0.5 * scaleX + x, 0.5 * scaleY + y, 0.5 * scaleZ + z); } // Bottom Face GL11.glColor4f(CLOUD_COLOR_1.x, CLOUD_COLOR_1.y, CLOUD_COLOR_1.z, CLOUD_COLOR_1.w); GL11.glTexCoord2f(0.5f, 0.5f); GL11.glVertex3d(-0.5 * scaleX + x, -0.5 * scaleY + y, -0.5 * scaleZ + z); GL11.glTexCoord2f(0.0f, 0.5f); GL11.glVertex3d(0.5 * scaleX + x, -0.5 * scaleY + y, -0.5 * scaleZ + z); GL11.glTexCoord2f(0.0f, 0.0f); GL11.glVertex3d(0.5 * scaleX + x, -0.5 * scaleY + y, 0.5 * scaleZ + z); GL11.glTexCoord2f(0.5f, 0.0f); GL11.glVertex3d(-0.5 * scaleX + x, -0.5 * scaleY + y, 0.5 * scaleZ + z); }
From source file:com.github.jtse.puzzle.ogl.Textures.java
License:Apache License
public static void renderImage(Texture texture, int x, int y, int z) { // Color.white.bind(); // texture.bind(); // or GL11.glBind(texture.getTextureID()); //GL11.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); GL11.glBindTexture(GL_TEXTURE_2D, texture.getTextureID()); // GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, // GL11.GL_MODULATE ); // when texture area is small, bilinear filter the closest mipmap // GL11.glTexParameterf( GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, // GL11.GL_LINEAR_MIPMAP_NEAREST ); // when texture area is large, bilinear filter the first mipmap // GL11.glTexParameterf( GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, // GL11.GL_LINEAR ); // GL11.glTexParameterf( GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, // GL11.GL_CLAMP ); // GL11.glTexParameterf( GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, // GL11.GL_CLAMP ); glBegin(GL11.GL_QUADS);/*from w w w .j av a 2 s . c om*/ GL11.glTexCoord2d(0.0d, 0.0d); GL11.glVertex3d(x, y, z); // It's 0.99 instead of 1.0 because 1.0 creates edge artifacts GL11.glTexCoord2d(0.99d, 0.0d); GL11.glVertex3d(x + texture.getTextureWidth(), y, z); GL11.glTexCoord2d(0.99d, 0.99d); GL11.glVertex3d(x + texture.getTextureWidth(), y + texture.getTextureHeight(), z); GL11.glTexCoord2d(0.0d, 0.99d); GL11.glVertex3d(x, y + texture.getTextureHeight(), z); glEnd(); }
From source file:com.irr310.i3d.scene.I3dCamera.java
License:Open Source License
public void display(float width, float height) { this.currentWidth = width; this.currentHeight = height; GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity();/* w w w . ja v a 2 s . co m*/ GL11.glOrtho(0, width, 0, height, -2000.0, 2000.0); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); backgroundScene.display(this); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); initPerspective(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); GL11.glPushMatrix(); configureView(glu); if (!configured) { configured = true; if (cameraInitialisation != null) { cameraInitialisation.run(); cameraInitialisation = null; } } GL11.glColor3f(1, 0, 0); GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(0, 0, 0); GL11.glVertex3d(100, 100, 100); GL11.glEnd(); preDisplayScene(); if (currentScene != null) { currentScene.display(this); } postDisplayScene(); preDisplayGui(); postDisplayGui(); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0, width, 0, height, -2000.0, 2000.0); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); hudScene.display(this); GL11.glPopMatrix(); }
From source file:com.irr310.i3d.scene.I3dEye3DCamera.java
License:Open Source License
private void displayTarget() { GL11.glColor4f(1.0f, 0.5f, 0.5f, 0.8f); GL11.glLineWidth(1.2f);/*from ww w . ja v a2s . c o m*/ GL11.glBegin(GL11.GL_LINES); { GL11.glColor4f(1.0f, 0.0f, 0.0f, 0.8f); GL11.glVertex3d(-1, 0, 0); GL11.glVertex3d(1, 0, 0); GL11.glVertex3d(0.9, 0.1, 0); GL11.glVertex3d(1, 0, 0); GL11.glVertex3d(0.9, -0.1, 0); GL11.glVertex3d(1, 0, 0); // y GL11.glColor4f(0.0f, 1.0f, 0.0f, 0.8f); GL11.glVertex3d(0, -1, 0); GL11.glVertex3d(0, 1, 0); GL11.glVertex3d(0.1, 0.9, 0); GL11.glVertex3d(0, 1, 0); GL11.glVertex3d(-0.1, 0.9, 0); GL11.glVertex3d(0, 1, 0); // z GL11.glColor4f(0.0f, 0.0f, 1.0f, 0.8f); GL11.glVertex3d(0, 0, -1); GL11.glVertex3d(0, 0, 1); GL11.glVertex3d(0.1, 0, 0.9); GL11.glVertex3d(0, 0, 1); GL11.glVertex3d(-0.1, 0, 0.9); GL11.glVertex3d(0, 0, 1); } GL11.glEnd(); GL11.glPointSize(1.2f); GL11.glBegin(GL11.GL_POINTS); { GL11.glVertex3d(position.x, position.y, position.z); } GL11.glEnd(); }
From source file:com.lothrazar.cyclicmagic.data.Vector3.java
License:Open Source License
@SideOnly(Side.CLIENT) public void glVertex() { GL11.glVertex3d(x, y, z); }
From source file:com.mrcrayfish.furniture.render.tileentity.BlenderRenderer.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tileEntity, double posX, double posY, double posZ, float p_180535_8_, int p_180535_9_) { TileEntityBlender blender = (TileEntityBlender) tileEntity; ItemStack[] ingredients = blender.getIngredients(); GL11.glPushMatrix();/* ww w .j av a 2 s . c om*/ GL11.glTranslatef((float) posX + 0.5F, (float) posY + 0.2F, (float) posZ + 0.5F); GL11.glScalef(0.65F, 0.65F, 0.65F); entityFood.hoverStart = 0.0F; for (int i = 0; i < ingredients.length; i++) { if (ingredients[i] != null) { entityFood.setEntityItemStack(ingredients[i]); GL11.glRotatef(i * -90F, 0, 1, 0); GL11.glRotatef(blender.progress * 18F, 0, 1, 0); Minecraft.getMinecraft().getRenderManager().renderEntityWithPosYaw(entityFood, 0.0D, 0.2D, 0.0D, 0.0F, 0.0F); } } GL11.glPopMatrix(); if (blender.isBlending() | blender.drinkCount > 0) { Tessellator tessellator = Tessellator.getInstance(); GL11.glPushMatrix(); GL11.glTranslatef((float) posX + 0.5F, (float) posY + 0.05F, (float) posZ + 0.5F); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_BLEND); float alpha = blender.isBlending() ? (blender.progress / 200F) : (blender.drinkCount > 0 ? 1.0F : 0.0F); GL11.glColor4f(blender.currentRed / 255F, blender.currentGreen / 255F, blender.currentBlue / 255F, alpha); float height = blender.isBlending() ? 0.8F : (0.275F + (0.525F * (blender.drinkCount / 6F))); GL11.glBegin(GL11.GL_QUADS); // North Face GL11.glVertex3d(-0.2, 0.275, -0.2); GL11.glVertex3d(0.2, 0.275, -0.2); GL11.glVertex3d(0.2, height, -0.2); GL11.glVertex3d(-0.2, height, -0.2); // South Face GL11.glVertex3d(-0.2, 0.275, 0.2); GL11.glVertex3d(0.2, 0.275, 0.2); GL11.glVertex3d(0.2, height, 0.2); GL11.glVertex3d(-0.2, height, 0.2); // West Face GL11.glVertex3d(-0.2, 0.275, -0.2); GL11.glVertex3d(-0.2, 0.275, 0.2); GL11.glVertex3d(-0.2, height, 0.2); GL11.glVertex3d(-0.2, height, -0.2); // East Face GL11.glVertex3d(0.2, 0.275, -0.2); GL11.glVertex3d(0.2, 0.275, 0.2); GL11.glVertex3d(0.2, height, 0.2); GL11.glVertex3d(0.2, height, -0.2); // Top Face GL11.glVertex3d(-0.2, height, -0.2); GL11.glVertex3d(0.2, height, -0.2); GL11.glVertex3d(0.2, height, 0.2); GL11.glVertex3d(-0.2, height, 0.2); // Bottom Face GL11.glVertex3d(-0.2, 0.275, -0.2); GL11.glVertex3d(0.2, 0.275, -0.2); GL11.glVertex3d(0.2, 0.275, 0.2); GL11.glVertex3d(-0.2, 0.275, 0.2); GL11.glEnd(); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F); GL11.glPopMatrix(); } }
From source file:com.mrcrayfish.furniture.render.tileentity.CupRenderer.java
License:Open Source License
@Override public void renderTileEntityAt(TileEntity tileEntity, double posX, double posY, double posZ, float p_180535_8_, int p_180535_9_) { TileEntityCup tileEntityCup = (TileEntityCup) tileEntity; if (tileEntityCup.getDrink() != null) { Tessellator tessellator = Tessellator.getInstance(); GL11.glPushMatrix();//from ww w . j av a 2 s . c om GL11.glTranslatef((float) posX + 0.5F, (float) posY, (float) posZ + 0.5F); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_BLEND); GL11.glColor4f(tileEntityCup.red / 255F, tileEntityCup.green / 255F, tileEntityCup.blue / 255F, 1.0F); GL11.glBegin(GL11.GL_QUADS); // North Face GL11.glVertex3d(-0.125, 0.5 * 0.0625, -0.125); GL11.glVertex3d(0.125, 0.5 * 0.0625, -0.125); GL11.glVertex3d(0.125, 0.4, -0.125); GL11.glVertex3d(-0.125, 0.4, -0.125); // South Face GL11.glVertex3d(-0.125, 0.5 * 0.0625, 0.125); GL11.glVertex3d(0.125, 0.5 * 0.0625, 0.125); GL11.glVertex3d(0.125, 0.4, 0.125); GL11.glVertex3d(-0.125, 0.4, 0.125); // West Face GL11.glVertex3d(-0.125, 0.5 * 0.0625, -0.125); GL11.glVertex3d(-0.125, 0.5 * 0.0625, 0.125); GL11.glVertex3d(-0.125, 0.4, 0.125); GL11.glVertex3d(-0.125, 0.4, -0.125); // East Face GL11.glVertex3d(0.125, 0.5 * 0.0625, -0.125); GL11.glVertex3d(0.125, 0.5 * 0.0625, 0.125); GL11.glVertex3d(0.125, 0.4, 0.125); GL11.glVertex3d(0.125, 0.4, -0.125); // Top Face GL11.glVertex3d(-0.125, 0.4, -0.125); GL11.glVertex3d(0.125, 0.4, -0.125); GL11.glVertex3d(0.125, 0.4, 0.125); GL11.glVertex3d(-0.125, 0.4, 0.125); // Bottom Face GL11.glVertex3d(-0.125, 0.5 * 0.0625, -0.125); GL11.glVertex3d(0.125, 0.5 * 0.0625, -0.125); GL11.glVertex3d(0.125, 0.5 * 0.0625, 0.125); GL11.glVertex3d(-0.125, 0.5 * 0.0625, 0.125); GL11.glEnd(); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glAlphaFunc(GL11.GL_GREATER, 0.5F); GL11.glPopMatrix(); } }
From source file:com.teambr.bookshelf.client.gui.component.control.GuiComponentSideSelector.java
License:Creative Commons License
/** * Draws the highlights onto the block//from w w w. ja v a 2 s.c o m * @param selections The colors to render */ private void drawHighlights(List<Pair<SidePicker.Side, Color>> selections) { GlStateManager.disableLighting(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.enableBlend(); GlStateManager.enableAlpha(); GlStateManager.disableDepth(); GlStateManager.disableTexture2D(); GL11.glBegin(GL11.GL_QUADS); for (Pair<SidePicker.Side, Color> pair : selections) { if (pair.getRight() != null) RenderUtils.setColor(pair.getRight()); switch (pair.getLeft()) { case XPos: GL11.glVertex3d(0.5, -0.5, -0.5); GL11.glVertex3d(0.5, 0.5, -0.5); GL11.glVertex3d(0.5, 0.5, 0.5); GL11.glVertex3d(0.5, -0.5, 0.5); break; case YPos: GL11.glVertex3d(-0.5, 0.5, -0.5); GL11.glVertex3d(-0.5, 0.5, 0.5); GL11.glVertex3d(0.5, 0.5, 0.5); GL11.glVertex3d(0.5, 0.5, -0.5); break; case ZPos: GL11.glVertex3d(-0.5, -0.5, 0.5); GL11.glVertex3d(0.5, -0.5, 0.5); GL11.glVertex3d(0.5, 0.5, 0.5); GL11.glVertex3d(-0.5, 0.5, 0.5); break; case XNeg: GL11.glVertex3d(-0.5, -0.5, -0.5); GL11.glVertex3d(-0.5, -0.5, 0.5); GL11.glVertex3d(-0.5, 0.5, 0.5); GL11.glVertex3d(-0.5, 0.5, -0.5); break; case YNeg: GL11.glVertex3d(-0.5, -0.5, -0.5); GL11.glVertex3d(0.5, -0.5, -0.5); GL11.glVertex3d(0.5, -0.5, 0.5); GL11.glVertex3d(-0.5, -0.5, 0.5); break; case ZNeg: GL11.glVertex3d(-0.5, -0.5, -0.5); GL11.glVertex3d(-0.5, 0.5, -0.5); GL11.glVertex3d(0.5, 0.5, -0.5); GL11.glVertex3d(0.5, -0.5, -0.5); break; default: } } GL11.glEnd(); GlStateManager.disableBlend(); GlStateManager.enableDepth(); GlStateManager.enableTexture2D(); }
From source file:com.teambr.bookshelf.client.gui.component.display.GuiComponentColoredZone.java
License:Creative Commons License
/** * Called to render the component//w w w . j a v a2s . c o m */ @Override public void render(int guiLeft, int guiTop, int mouseX, int mouseY) { color = getDynamicColor(); GlStateManager.pushMatrix(); GlStateManager.disableLighting(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.enableBlend(); GlStateManager.enableAlpha(); GlStateManager.disableDepth(); GlStateManager.disableTexture2D(); GlStateManager.translate(xPos, yPos, 10); RenderUtils.setColor(color); GL11.glBegin(GL11.GL_QUADS); GL11.glVertex3d(0, 0, 0); GL11.glVertex3d(0, height, 0); GL11.glVertex3d(width, height, 0); GL11.glVertex3d(width, 0, 0); GL11.glEnd(); GlStateManager.disableBlend(); GlStateManager.enableDepth(); GlStateManager.enableTexture2D(); GlStateManager.popMatrix(); }
From source file:com.wicpar.sinkingsimulatorclassic.Ground.java
License:Open Source License
@Override public void draw() { GL11.glEnable(GL11.GL_DEPTH_TEST);//w ww . ja v a 2s . c o m GL11.glBegin(GL11.GL_QUADS); GL11.glColor4f(FloorColor.r, FloorColor.g, FloorColor.b, FloorColor.a); double h = Main.ClassicSinkingSim.getInstance().getCam().transformY(this.h); GL11.glVertex3d(-1, h, -0.8); GL11.glVertex3d(-1, -1, -0.8); GL11.glVertex3d(1, -1, -0.8); GL11.glVertex3d(1, h, -0.8); GL11.glEnd(); GL11.glDisable(GL11.GL_DEPTH_TEST); }