I'm thinking something with intersecting lines and finding the point where they intersect. Not 100% on how to find that though.
I need it to find out the point the user begins to change touch direction in my game.
Well on this particular triangle, it's fairly easy.
B.x = C.x
B.y = A.y
BUT the problem is (I forgot to mention this), the triangle could be tilted / rotated any way on a X / Y plane.
On this triangle:
Show a formula for finding co-ordinates of B.
You know:
- the co-ordinates of A and C;
- Angle B = 90 degrees
Is this possible? If not, is it possible if you know all 3 angles?
I changed the plan a bit. The plan is to re-create each point of the user's touch path on the SAME x coordinate then adjust the y-coordinate based on the corresponding x-coordinate to create a straight line between the start and end point.
This is what I have I changed a lot:
(Thanks for the...
This is the main part of the code:
Mod note: Redid the indentation in your code to make it easier to read, and so that it wouldn't scroll off the right edge as much.[/color]
int lastIndex = touchPoints [touch.fingerId].Count - 1;
float touchLength =
Vector2.Distance (touchPoints...
The basic idea is, the user draws a line on the screen. Now, when the user draws a line, it won't be perfect. It will also contain a certain number of points. (The number of points is determined by how fast the user moves his finger.) Then I create a perfect line from the point the user started...
Thanks for your reply.
I changed 'j' to start at 0 and also changed #4 to this:
perfectPoint.x = touchPoints [touch.fingerId] [0].x + (((touchPoints [touch.fingerId] [lastIndex].x - touchPoints [touch.fingerId] [0].x) / touchPoints [touch.fingerId].Count) * j);
This gives me the...
I know it's long but I really need help. I'm terrible at math. Anyway, given only a start and end point, I'm trying to draw a line by creating a number of points at regular intervals between those start and end points.
This is what I have so far (it's from C# code so I hope it's not too hard to...