Java Code Examples for org.lwjgl.opengl.GL11#glVertex3d()
The following examples show how to use
org.lwjgl.opengl.GL11#glVertex3d() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemEspHack.java From Wurst7 with GNU General Public License v3.0 | 6 votes |
private void renderTracers(double partialTicks) { GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glColor4f(1, 1, 0, 0.5F); Vec3d start = RotationUtils.getClientLookVec().add(RenderUtils.getCameraPos()); GL11.glBegin(GL11.GL_LINES); for(ItemEntity e : items) { Vec3d end = e.getBoundingBox().getCenter() .subtract(new Vec3d(e.getX(), e.getY(), e.getZ()) .subtract(e.prevX, e.prevY, e.prevZ) .multiply(1 - partialTicks)); GL11.glVertex3d(start.x, start.y, start.z); GL11.glVertex3d(end.x, end.y, end.z); } GL11.glEnd(); }
Example 2
Source File: MobEspHack.java From ForgeWurst with GNU General Public License v3.0 | 6 votes |
private void renderTracers(double partialTicks) { Vec3d start = RotationUtils.getClientLookVec() .addVector(0, WMinecraft.getPlayer().getEyeHeight(), 0) .addVector(TileEntityRendererDispatcher.staticPlayerX, TileEntityRendererDispatcher.staticPlayerY, TileEntityRendererDispatcher.staticPlayerZ); GL11.glBegin(GL11.GL_LINES); for(EntityLiving e : mobs) { Vec3d end = e.getEntityBoundingBox().getCenter() .subtract(new Vec3d(e.posX, e.posY, e.posZ) .subtract(e.prevPosX, e.prevPosY, e.prevPosZ) .scale(1 - partialTicks)); float f = WEntity.getDistance(WMinecraft.getPlayer(), e) / 20F; GL11.glColor4f(2 - f, f, 0, 0.5F); GL11.glVertex3d(WVec3d.getX(start), WVec3d.getY(start), WVec3d.getZ(start)); GL11.glVertex3d(WVec3d.getX(end), WVec3d.getY(end), WVec3d.getZ(end)); } GL11.glEnd(); }
Example 3
Source File: PlayerEspHack.java From ForgeWurst with GNU General Public License v3.0 | 6 votes |
private void renderLines(double partialTicks) { Vec3d start = RotationUtils.getClientLookVec() .addVector(0, WMinecraft.getPlayer().getEyeHeight(), 0) .addVector(TileEntityRendererDispatcher.staticPlayerX, TileEntityRendererDispatcher.staticPlayerY, TileEntityRendererDispatcher.staticPlayerZ); GL11.glBegin(GL11.GL_LINES); for(EntityPlayer e : players) { Vec3d end = e.getEntityBoundingBox().getCenter() .subtract(new Vec3d(e.posX, e.posY, e.posZ) .subtract(e.prevPosX, e.prevPosY, e.prevPosZ) .scale(1 - partialTicks)); float f = WEntity.getDistance(WMinecraft.getPlayer(), e) / 20F; GL11.glColor4f(2 - f, f, 0, 0.5F); GL11.glVertex3d(WVec3d.getX(start), WVec3d.getY(start), WVec3d.getZ(start)); GL11.glVertex3d(WVec3d.getX(end), WVec3d.getY(end), WVec3d.getZ(end)); } GL11.glEnd(); }
Example 4
Source File: AutoFishHack.java From ForgeWurst with GNU General Public License v3.0 | 6 votes |
@Override protected void onEnable() { timer = 0; lastSoundPos = null; box = GL11.glGenLists(1); cross = GL11.glGenLists(1); GL11.glNewList(cross, GL11.GL_COMPILE); GL11.glColor4f(1, 0, 0, 0.5F); GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(-0.125, 0, -0.125); GL11.glVertex3d(0.125, 0, 0.125); GL11.glVertex3d(0.125, 0, -0.125); GL11.glVertex3d(-0.125, 0, 0.125); GL11.glEnd(); GL11.glEndList(); MinecraftForge.EVENT_BUS.register(this); }
Example 5
Source File: MobEspHack.java From Wurst7 with GNU General Public License v3.0 | 6 votes |
private void renderTracers(double partialTicks) { Vec3d start = RotationUtils.getClientLookVec().add(RenderUtils.getCameraPos()); GL11.glBegin(GL11.GL_LINES); for(MobEntity e : mobs) { Vec3d end = e.getBoundingBox().getCenter() .subtract(new Vec3d(e.getX(), e.getY(), e.getZ()) .subtract(e.prevX, e.prevY, e.prevZ) .multiply(1 - partialTicks)); float f = MC.player.distanceTo(e) / 20F; GL11.glColor4f(2 - f, f, 0, 0.5F); GL11.glVertex3d(start.x, start.y, start.z); GL11.glVertex3d(end.x, end.y, end.z); } GL11.glEnd(); }
Example 6
Source File: CaveFinderHack.java From Wurst7 with GNU General Public License v3.0 | 6 votes |
private void setDisplayListFromTask() { ArrayList<int[]> vertices; try { vertices = compileVerticesTask.get(); }catch(InterruptedException | ExecutionException e) { throw new RuntimeException(e); } GL11.glNewList(displayList, GL11.GL_COMPILE); for(int[] vertex : vertices) GL11.glVertex3d(vertex[0], vertex[1], vertex[2]); GL11.glEndList(); displayListUpToDate = true; }
Example 7
Source File: BaseFinderHack.java From Wurst7 with GNU General Public License v3.0 | 5 votes |
@Override public void onRender(float partialTicks) { // GL settings GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_LIGHTING); GL11.glColor4f(1F, 0F, 0F, 0.15F); GL11.glPushMatrix(); RenderUtils.applyRenderOffset(); // vertices GL11.glBegin(GL11.GL_QUADS); { for(int[] vertex : vertices) GL11.glVertex3d(vertex[0], vertex[1], vertex[2]); } GL11.glEnd(); GL11.glPopMatrix(); // GL resets GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1, 1, 1, 1); }
Example 8
Source File: RenderUtils.java From ForgeWurst with GNU General Public License v3.0 | 5 votes |
public static void drawOutlinedBox(AxisAlignedBB bb) { GL11.glVertex3d(bb.minX, bb.minY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.minY, bb.minZ); GL11.glVertex3d(bb.minX, bb.minY, bb.minZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.minZ); }
Example 9
Source File: RenderUtils.java From ForgeWurst with GNU General Public License v3.0 | 5 votes |
public static void drawSolidBox(AxisAlignedBB bb) { GL11.glVertex3d(bb.minX, bb.minY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.minZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.minZ); GL11.glVertex3d(bb.minX, bb.minY, bb.minZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.minZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.maxX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.maxX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.minY, bb.minZ); GL11.glVertex3d(bb.minX, bb.minY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.maxZ); GL11.glVertex3d(bb.minX, bb.maxY, bb.minZ); }
Example 10
Source File: ItemEspHack.java From ForgeWurst with GNU General Public License v3.0 | 5 votes |
private void renderTracers(double partialTicks) { GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glColor4f(1, 1, 0, 0.5F); Vec3d start = RotationUtils.getClientLookVec() .addVector(0, WMinecraft.getPlayer().getEyeHeight(), 0) .addVector(TileEntityRendererDispatcher.staticPlayerX, TileEntityRendererDispatcher.staticPlayerY, TileEntityRendererDispatcher.staticPlayerZ); GL11.glBegin(GL11.GL_LINES); for(EntityItem e : items) { Vec3d end = e.getEntityBoundingBox().getCenter() .subtract(new Vec3d(e.posX, e.posY, e.posZ) .subtract(e.prevPosX, e.prevPosY, e.prevPosZ) .scale(1 - partialTicks)); GL11.glVertex3d(WVec3d.getX(start), WVec3d.getY(start), WVec3d.getZ(start)); GL11.glVertex3d(WVec3d.getX(end), WVec3d.getY(end), WVec3d.getZ(end)); } GL11.glEnd(); }
Example 11
Source File: GuiComponentColorPicker.java From OpenModsLib with MIT License | 5 votes |
@Override public void render(int offsetX, int offsetY, int mouseX, int mouseY) { GlStateManager.color(1, 1, 1, 1); int renderX = offsetX + x; int renderY = offsetY + y; bindComponentsSheet(); drawTexturedModalRect(renderX, renderY, 156, 206, getWidth(), getColorsHeight()); drawRect(renderX, renderY, renderX + getWidth(), renderY + getColorsHeight(), (tone << 24) | 0xFFFFFF); GlStateManager.enableBlend(); GlStateManager.disableTexture2D(); GlStateManager.disableAlpha(); GlStateManager.shadeModel(GL11.GL_SMOOTH); GL11.glBegin(GL11.GL_QUADS); GlStateManager.color(0, 0, 0, 1.0f); GL11.glVertex3d(renderX, renderY + getColorsHeight(), 0.0); GL11.glVertex3d(renderX + getWidth(), renderY + getColorsHeight(), 0.0); GlStateManager.color(0, 0, 0, 0f); GL11.glVertex3d(renderX + getWidth(), renderY, 0.0D); GL11.glVertex3d(renderX, renderY, 0.0); GL11.glEnd(); GlStateManager.shadeModel(GL11.GL_FLAT); GlStateManager.disableBlend(); GlStateManager.enableTexture2D(); GlStateManager.enableAlpha(); drawRect(renderX + pointX - 1, renderY + pointY - 1, renderX + pointX + 1, renderY + pointY + 1, 0xCCCC0000); }
Example 12
Source File: ChestEspHack.java From Wurst7 with GNU General Public License v3.0 | 5 votes |
private void renderLines(Vec3d start, ArrayList<Box> boxes) { for(Box box : boxes) { Vec3d end = box.getCenter(); GL11.glVertex3d(start.x, start.y, start.z); GL11.glVertex3d(end.x, end.y, end.z); } }
Example 13
Source File: TrajectoriesHack.java From Wurst7 with GNU General Public License v3.0 | 5 votes |
private void drawLine(ArrayList<Vec3d> path, Vec3d camPos) { GL11.glBegin(GL11.GL_LINE_STRIP); GL11.glColor4f(0, 1, 0, 0.75F); for(Vec3d point : path) GL11.glVertex3d(point.x - camPos.x, point.y - camPos.y, point.z - camPos.z); GL11.glEnd(); }
Example 14
Source File: RocketRenderHelper.java From AdvancedRocketry with MIT License | 5 votes |
public static void renderOrbit(double x, double y, double z, double xRadius, double yRadius, double xOffset, double yOffset) { GL11.glLineWidth(20/(float)(Math.pow(x - 0.5 - xOffset, 2) + Math.pow(y - 0.5 - yOffset, 2) + Math.pow(z - 0.5, 2))); GL11.glBegin(GL11.GL_LINE_STRIP); for(int i = 0; i < 13; i++) GL11.glVertex3d(xOffset + 0.5 + xRadius*Math.cos((Math.PI*i)/6)/2.2, yOffset - 0.5 + yRadius*Math.sin((Math.PI*i)/6)/2.2, 0); GL11.glEnd(); }
Example 15
Source File: AutoFishHack.java From Wurst7 with GNU General Public License v3.0 | 5 votes |
@Override public void onEnable() { bestRodValue = -1; bestRodSlot = -1; castRodTimer = 0; reelInTimer = -1; scheduledWindowClick = -1; lastSoundPos = null; box = GL11.glGenLists(1); cross = GL11.glGenLists(1); GL11.glNewList(cross, GL11.GL_COMPILE); GL11.glColor4f(1, 0, 0, 0.5F); GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(-0.125, 0, -0.125); GL11.glVertex3d(0.125, 0, 0.125); GL11.glVertex3d(0.125, 0, -0.125); GL11.glVertex3d(-0.125, 0, 0.125); GL11.glEnd(); GL11.glEndList(); EVENTS.add(UpdateListener.class, this); EVENTS.add(PacketInputListener.class, this); EVENTS.add(RenderListener.class, this); }
Example 16
Source File: Vector3.java From CodeChickenLib with GNU Lesser General Public License v2.1 | 4 votes |
@SideOnly(Side.CLIENT) public void glVertex() { GL11.glVertex3d(x, y, z); }
Example 17
Source File: PlayerFinderHack.java From Wurst7 with GNU General Public License v3.0 | 4 votes |
@Override public void onRender(float partialTicks) { if(pos == null) return; // GL settings GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glLineWidth(2); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_LIGHTING); GL11.glPushMatrix(); RenderUtils.applyRenderOffset(); // generate rainbow color float x = System.currentTimeMillis() % 2000 / 1000F; float red = 0.5F + 0.5F * MathHelper.sin(x * (float)Math.PI); float green = 0.5F + 0.5F * MathHelper.sin((x + 4F / 3F) * (float)Math.PI); float blue = 0.5F + 0.5F * MathHelper.sin((x + 8F / 3F) * (float)Math.PI); GL11.glColor4f(red, green, blue, 0.5F); // tracer line GL11.glBegin(GL11.GL_LINES); { // set start position Vec3d start = RotationUtils.getClientLookVec() .add(RenderUtils.getCameraPos()); // set end position Vec3d end = Vec3d.ofCenter(pos); // draw line GL11.glVertex3d(start.x, start.y, start.z); GL11.glVertex3d(end.x, end.y, end.z); } GL11.glEnd(); // block box { GL11.glPushMatrix(); GL11.glTranslated(pos.getX(), pos.getY(), pos.getZ()); RenderUtils.drawOutlinedBox(); GL11.glColor4f(red, green, blue, 0.25F); RenderUtils.drawSolidBox(); GL11.glPopMatrix(); } GL11.glPopMatrix(); // GL resets GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_LINE_SMOOTH); }
Example 18
Source File: ModelVortexTube.java From PneumaticCraft with GNU General Public License v3.0 | 4 votes |
private void renderBox(int heatLevel){ double minX = 0; double minY = 0; double minZ = 0; double maxX = 1; double maxY = 1; double maxZ = 2 / 16D; double[] color = TileEntityCompressedIronBlock.getColorForHeatLevel(heatLevel); GL11.glColor4d(color[0], color[1], color[2], (1 - color[1]) / 2); GL11.glBegin(GL11.GL_QUADS); GL11.glVertex3d(minX, maxY, maxZ); GL11.glVertex3d(maxX, maxY, maxZ); GL11.glVertex3d(maxX, maxY, minZ); GL11.glVertex3d(minX, maxY, minZ); GL11.glVertex3d(maxX, minY, maxZ); GL11.glVertex3d(minX, minY, maxZ); GL11.glVertex3d(minX, minY, minZ); GL11.glVertex3d(maxX, minY, minZ); GL11.glVertex3d(minX, minY, maxZ); GL11.glVertex3d(minX, maxY, maxZ); GL11.glVertex3d(minX, maxY, minZ); GL11.glVertex3d(minX, minY, minZ); GL11.glVertex3d(maxX, minY, minZ); GL11.glVertex3d(maxX, maxY, minZ); GL11.glVertex3d(maxX, maxY, maxZ); GL11.glVertex3d(maxX, minY, maxZ); GL11.glVertex3d(minX, minY, minZ); GL11.glVertex3d(minX, maxY, minZ); GL11.glVertex3d(maxX, maxY, minZ); GL11.glVertex3d(maxX, minY, minZ); GL11.glVertex3d(minX, minY, maxZ); GL11.glVertex3d(maxX, minY, maxZ); GL11.glVertex3d(maxX, maxY, maxZ); GL11.glVertex3d(minX, maxY, maxZ); GL11.glEnd(); }
Example 19
Source File: FreecamHack.java From Wurst7 with GNU General Public License v3.0 | 4 votes |
@Override public void onRender(float partialTicks) { if(fakePlayer == null || !tracer.isChecked()) return; // GL settings GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glEnable(GL11.GL_LINE_SMOOTH); GL11.glLineWidth(2); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_LIGHTING); GL11.glPushMatrix(); RenderUtils.applyRenderOffset(); GL11.glColor4f(1, 1, 1, 0.5F); // box GL11.glPushMatrix(); GL11.glTranslated(fakePlayer.getX(), fakePlayer.getY(), fakePlayer.getZ()); GL11.glScaled(fakePlayer.getWidth() + 0.1, fakePlayer.getHeight() + 0.1, fakePlayer.getWidth() + 0.1); GL11.glCallList(playerBox); GL11.glPopMatrix(); // line Vec3d start = RotationUtils.getClientLookVec().add(RenderUtils.getCameraPos()); Vec3d end = fakePlayer.getBoundingBox().getCenter(); GL11.glBegin(GL11.GL_LINES); GL11.glVertex3d(start.x, start.y, start.z); GL11.glVertex3d(end.x, end.y, end.z); GL11.glEnd(); GL11.glPopMatrix(); // GL resets GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_LINE_SMOOTH); }
Example 20
Source File: GuiComponentTankLevel.java From OpenModsLib with MIT License | 4 votes |
private static void addVertexWithUV(double x, double y, double z, float u, float v) { GL11.glTexCoord2f(u, v); GL11.glVertex3d(x, y, z); }