Question about the rendered box
Bbalduzz opened this issue · 0 comments
Bbalduzz commented
Hi,
I found this repo really useful, so thanks for sharing. However I have a question: how could I render the esp box such as only the angles are rendered? so, instead of a full rectangle only four angles are shown?
I tried to do that by changing the DrawBox
function. The idea was to change the points used to draw the lines.
The model is:
The code result in:
public static void DrawBox(float x, float y, float w, float h, Color color, float thickness)
{
Vector2 P1 = new Vector2(x, y);
Vector2 P2 = new Vector2(((x+w)/2)-10, y);
Vector2 P3 = new Vector2(((x+w)/2)+10, y);
Vector2 P4 = new Vector2(x+w, y);
Vector2 P5 = new Vector2(x, ((y+h)/2)-20);
Vector2 P6 = new Vector2(x, ((y+h)/2)+20);
Vector2 P7 = new Vector2(x, y+h);
Vector2 P8 = new Vector2(((x+w)/2)-10, y+h);
Vector2 P9 = new Vector2(((x+w)/2)+10, y+h);
Vector2 P10 = new Vector2(x+w, y+h);
Vector2 P11 = new Vector2(x+w, ((y+h)/2)+20);
Vector2 P12 = new Vector2(x+w, ((y+h)/2)+20);
DrawLine(P1, P2, color, thickness);
DrawLine(P1, P5, color, thickness);
DrawLine(P3, P4, color, thickness);
DrawLine(P4, P12, color, thickness);
DrawLine(P6, P7, color, thickness);
DrawLine(P7, P8, color, thickness);
DrawLine(P9, P10, color, thickness);
DrawLine(P10, P11, color, thickness);
}
However it seems not to be working.
The result is:
Do u have any idea of the reason, or do u have a solution?