- Edited
Hello!
First of all i'm using Godot 2.1.4.
I've been wrestling for a while now with an issue involving drawing a polygonal line between two coordinates, a fixed coordinate and a moving one, e.g. the user's mouse cursor. Until now i've been unable to successfully calculate the coordinates of each of the corners of this polygon with a given angle without any bizarre effects.
Basically, each of the opposite faces of the polygon have to be perpendicular to the vector that connects the two of them.
I will share with you some of my current implementations to demonstrate my problem. A scene with a 2DNode with any of the scripts below attached is enough
No matter what i try, it always ends up with the same strange result where the opposite faces do not remain perpendicular to the vector connecting both points, and i have no idea what i'm doing wrong. If anyone could help i'd be deeply thankful!
I've uploaded the relevant .gd demo files that demonstrate my issue and dropped the links to those uploaded files herein, since the forum's code formatting feature is buggy to say the least.