Hello everyone, I have an issue that I have yet to find a solution to. I have come up with a way in which to increase the width of the GL.Lines function however in quadrant 2 and quadrant 4 the line converges on itself. I am using two windows which can be dragged around and I want a line to attach to the corner of them at all times, I have all of that working except for this last piece. Heres what I have for code right now. I have thought about using GL.Quads but its doesn’t seem to come out quite right.
bool quadrant = false;
if ((pointRect.x > point2Rect.x && pointRect.y > point2Rect.y) || (pointRect.x < point2Rect.x && pointRect.y < point2Rect.y))
{
quadrant = false;
}
else
{
quadrant = true;
}
GL.PushMatrix();
mat.SetPass(0);
GL.LoadOrtho();
GL.Begin(GL.LINES);
if (quadrant)
{
for(float i = 30.25f; i < 34.25f; i +=.01f)
{
GL.Vertex(new Vector3((pointRect.x + i)/Screen.width, 1 - (pointRect.y + (i + 50.75f))/Screen.height, 0));
GL.Vertex(new Vector3((point2Rect.x + i)/Screen.width, 1 - (point2Rect.y + (i+50.75f))/Screen.height, 0));
}
}
else
{
for(float i = 30.25f; i < 34.25f; i +=.01f)
{
GL.Vertex(new Vector3((pointRect.x + i)/Screen.width, 1 - (pointRect.y + (i + 50.75f))/Screen.height, 0));
GL.Vertex(new Vector3((point2Rect.x + i)/Screen.width, 1 - (point2Rect.y + (i+50.75f))/Screen.height, 0));
}
}
GL.End();
GL.PopMatrix();