I’m trying to get tracers(Lines) to go from my crosshair(middle of the screen) to the other entities ingame. This is what I’ve gotten so far and I can’t seem to figure it out.
if(GuiIngame.tracer)
{
List players = mc.theWorld.getLoadedEntityList();
for (int k1 = 0; k1 < players.size();k1++)
{
EntityPlayer p;
if (players.get(k1) instanceof EntityPlayer)
p = (EntityPlayer) players.get(k1);
else
continue;
if (p!=mc.thePlayer && p!=null)
{
double posX = p.posX - mc.thePlayer.posX;
double posY = p.posY - mc.thePlayer.posY;
double posZ = p.posZ - mc.thePlayer.posZ;
double xc = posX / posZ;
double yc = posY / posZ;
//double mx = mc.thePlayer.posX / mc.thePlayer.posZ;
//double my = mc.thePlayer.posY / mc.thePlayer.posZ;
//xc = xc-mx;
//yc = yc-my;
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(0.0F, 1.0F, 1.0F, 1.0F);
GL11.glLineWidth(2);
GL11.glBegin(GL11.GL_LINES);
GL11.glVertex2d(0D, 0D);
GL11.glVertex2d(xc, yc);
GL11.glEnd();
GL11.glDisable(GL11.GL_BLEND);
}
else
continue;
}
}