Example usage for org.lwjgl.opengl GL11 glLineWidth

List of usage examples for org.lwjgl.opengl GL11 glLineWidth

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glLineWidth.

Prototype

public static void glLineWidth(@NativeType("GLfloat") float width) 

Source Link

Document

Sets the width of rasterized line segments.

Usage

From source file:info.plugmania.novacraft.event.gui.Render3DOverlayEvent.java

License:GNU General Public License

public void drawLine(Position point1, Position point2, int colour, float lineWidth) {
    float red = (float) (colour >> 24 & 255) / 255.0F;
    float green = (float) (colour >> 16 & 255) / 255.0F;
    float blue = (float) (colour >> 8 & 255) / 255.0F;
    float alpha = (float) (colour & 255) / 255.0F;
    GL11.glColor4f(red, green, blue, alpha);
    GL11.glLineWidth(lineWidth);
    enable();/*from  w w w. j a v a 2  s .c o m*/
    GL11.glBegin(GL11.GL_LINES);
    GL11.glVertex3d(point1.getX() - p.posX, point1.getY() - p.posY, point1.getZ() - p.posZ);
    GL11.glVertex3d(point2.getX() - p.posX, point2.getY() - p.posY, point2.getZ() - p.posZ);
    GL11.glEnd();
    disable();
}

From source file:info.plugmania.novacraft.event.gui.Render3DOverlayEvent.java

License:GNU General Public License

public void drawCylinder(Position position, float radius, int slices, int stacks, float lineWidth, int colour) {
    float red = (float) (colour >> 24 & 255) / 255.0F;
    float green = (float) (colour >> 16 & 255) / 255.0F;
    float blue = (float) (colour >> 8 & 255) / 255.0F;
    float alpha = (float) (colour & 255) / 255.0F;
    Cylinder cylinder = new Cylinder();
    enable();/*from   w ww .  j av a2s. c o m*/
    GL11.glColor4f(red, green, blue, alpha);
    GL11.glTranslated(position.getX() - p.posX, position.getY() - p.posY, position.getZ() - p.posZ);
    GL11.glRotatef(600F, 1, 1, 1);
    GL11.glLineWidth(lineWidth);
    cylinder.setDrawStyle(GLU.GLU_SILHOUETTE);
    cylinder.draw(radius, radius, 2F, slices, stacks);
    disable();

}

From source file:info.plugmania.novacraft.event.gui.Render3DOverlayEvent.java

License:GNU General Public License

public void drawSphere(Position position, float size, int slices, int stacks, float lineWidth, int colour) {
    float red = (float) (colour >> 24 & 255) / 255.0F;
    float green = (float) (colour >> 16 & 255) / 255.0F;
    float blue = (float) (colour >> 8 & 255) / 255.0F;
    float alpha = (float) (colour & 255) / 255.0F;
    Sphere sphere = new Sphere();
    enable();/*from w  ww. ja v a  2  s . com*/
    GL11.glColor4f(red, green, blue, alpha);
    GL11.glTranslated(position.getX() - p.posX, position.getY() - p.posY, position.getZ() - p.posZ);
    GL11.glRotatef(600F, 1, 1, 1);
    GL11.glLineWidth(lineWidth);
    sphere.setDrawStyle(GLU.GLU_SILHOUETTE);
    sphere.draw(size, slices, stacks);
    disable();
}

From source file:io.root.gfx.glutils.GL.java

License:Apache License

public static void glLineWidth(float width) {
    GL11.glLineWidth(width);
}

From source file:ivorius.ivtoolkit.raytracing.IvRaytracer.java

License:Apache License

public static void drawStandardOutlines(List<IvRaytraceableObject> objects) {
    GL11.glEnable(GL11.GL_BLEND);//from w  ww . j  a v a  2 s. c om
    OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
    GL11.glLineWidth(2.0F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDepthMask(false);
    //      GL11.glColor4f(0, 0, 0, 0.4f);

    Random r = new Random(0);
    for (IvRaytraceableObject object : objects) {
        int color = r.nextInt();
        GL11.glColor4f(((color >> 16) & 255) / 255.0f, ((color >> 8) & 255) / 255.0f,
                ((color >> 0) & 255) / 255.0f, 0.8F);
        object.drawOutlines();
    }

    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_BLEND);
}

From source file:matteroverdrive.gui.GuiWeaponStation.java

License:Open Source License

@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
    super.drawGuiContainerForegroundLayer(mouseX, mouseY);

    ItemStack item = machine.getStackInSlot(machine.INPUT_SLOT);
    if (WeaponHelper.isWeapon(item) && pages.get(0).isVisible()) {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        GL11.glPushMatrix();/*from  w  w w. j  a  va 2 s  . c om*/
        GL11.glLineWidth(1f);
        GL11.glColor4f(Reference.COLOR_MATTER.getFloatR(), Reference.COLOR_MATTER.getFloatG(),
                Reference.COLOR_MATTER.getFloatB(), 1);

        IWeapon weapon = (IWeapon) item.getItem();
        for (int i = 0; i < module_slots.length; i++) {
            if (weapon.supportsModule(i, item)) {
                GL11.glBegin(GL11.GL_LINES);
                Vector2f slotPos = weapon.getSlotPosition(i, item);
                Vector2f modulePos = weapon.getModuleScreenPosition(i, item);
                slotPos = getClosestOnSlot(slotPos, modulePos);

                GL11.glVertex3f(slotPos.x, slotPos.y, 0);
                GL11.glVertex3f(modulePos.x, modulePos.y, 0);
                GL11.glEnd();
            }
        }

        GL11.glPopMatrix();
        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
}

From source file:me.lixko.lixkopack.util.RenderUtils.java

License:Open Source License

/**
 * Renders a box with any size and any color.
 *
 * @param x//from  w  w  w  .  j  a v  a  2  s  .com
 * @param y
 * @param z
 * @param x2
 * @param y2
 * @param z2
 * @param color
 */
public static void box(double x, double y, double z, double x2, double y2, double z2, Color color) {
    x = x - Minecraft.getMinecraft().getRenderManager().renderPosX;
    y = y - Minecraft.getMinecraft().getRenderManager().renderPosY;
    z = z - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    x2 = x2 - Minecraft.getMinecraft().getRenderManager().renderPosX;
    y2 = y2 - Minecraft.getMinecraft().getRenderManager().renderPosY;
    z2 = z2 - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    GL11.glBlendFunc(770, 771);
    GL11.glEnable(GL_BLEND);
    GL11.glLineWidth(2.0F);
    RenderUtil.setColor(color);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    drawColorBox(new AxisAlignedBB(x, y, z, x2, y2, z2));
    GL11.glColor4d(0, 0, 0, 0.5F);
    RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2), -1);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDisable(GL_BLEND);
}

From source file:me.lixko.lixkopack.util.RenderUtils.java

License:Open Source License

/**
 * Renders a frame with any size and any color.
 *
 * @param x// w  w  w .j a v  a 2s  .co m
 * @param y
 * @param z
 * @param x2
 * @param y2
 * @param z2
 * @param color
 */
public static void frame(double x, double y, double z, double x2, double y2, double z2, Color color) {
    x = x - Minecraft.getMinecraft().getRenderManager().renderPosX;
    y = y - Minecraft.getMinecraft().getRenderManager().renderPosY;
    z = z - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    x2 = x2 - Minecraft.getMinecraft().getRenderManager().renderPosX;
    y2 = y2 - Minecraft.getMinecraft().getRenderManager().renderPosY;
    z2 = z2 - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    GL11.glBlendFunc(770, 771);
    GL11.glEnable(GL_BLEND);
    GL11.glLineWidth(2.0F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    RenderUtil.setColor(color);
    RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2), -1);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDisable(GL_BLEND);
}

From source file:me.lixko.lixkopack.util.RenderUtils.java

License:Open Source License

/**
 * Renders an ESP box with the size of a normal block at the specified
 * coordinates./*from www .  ja  v  a 2 s .c om*/
 *
 * @param x
 * @param y
 * @param z
 */
public static void blockESPBox(BlockPos blockPos) {
    double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
    double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
    double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    GL11.glBlendFunc(770, 771);
    GL11.glEnable(GL_BLEND);
    GL11.glLineWidth(1.0F);
    GL11.glColor4d(0, 1, 0, 0.15F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
    GL11.glColor4d(0, 0, 0, 0.5F);
    RenderGlobal.drawOutlinedBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), -1);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDisable(GL_BLEND);
}

From source file:me.lixko.lixkopack.util.RenderUtils.java

License:Open Source License

public static void framelessBlockESP(BlockPos blockPos, Color color) {
    double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
    double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
    double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    GL11.glBlendFunc(770, 771);/*  w  w  w.  ja v  a  2 s .  co m*/
    GL11.glEnable(GL_BLEND);
    GL11.glLineWidth(2.0F);
    GL11.glColor4d(color.getRed() / 255, color.getGreen() / 255, color.getBlue() / 255, 0.15);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    GL11.glDisable(GL_BLEND);
}