Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Grammar error on my part
Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

How can I detect if whenwhether a point is moving in a circle?

Clarifying
Source Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

How can I detect if I move circular with my Gameobjectwhen a point is moving in a circle?

I want to detect if my GameobjectGameObject (Vector3 PointVector3 Point) being dragged by the player's finger is moving in a circular fashion. For that i

I thought its a good idea to safeI could save the last 5 Pointspoints every 10 frames and make line-Vectors out of itjoin them by lines.

  Then I thought II'd project them into a "defined" Planeplane. And then I thought From there, I have Floating Vectors - now i thought I checkcan form the perpendicular normalsbisectors of those vectorsline segments - to check where they are intersecting. If

If every intersection point is very nearby - the finger is Circulatingswiping in a circle!

enter image description hereDiagram of proposed strategy using perpendicular bisectors

Now I only need to check if the intersection point is close. How

How can I check if they intersect? Or is there a better way to solve this?

And am I even doing this right?Here's my code so far:

How can I detect if I move circular with my Gameobject?

I want to detect if my Gameobject (Vector3 Point) is moving circular. For that i thought its a good idea to safe the last 5 Points every 10 frames and make line-Vectors out of it.

  Then I thought I project them into a "defined" Plane. And then I thought I have Floating Vectors - now i thought I check the perpendicular normals of those vectors - check where they are intersecting. If every intersection point is very nearby - the finger is Circulating!

enter image description here

Now I only need to check if the intersection point is close. How can I check if they intersect?

And am I even doing this right?

How can I detect if when a point is moving in a circle?

I want to detect if my GameObject (Vector3 Point) being dragged by the player's finger is moving in a circular fashion.

I thought I could save the last 5 points every 10 frames and join them by lines. Then I'd project them into a "defined" plane. From there, I can form the perpendicular bisectors of those line segments - to check where they are intersecting.

If every intersection point is very nearby - the finger is swiping in a circle!

Diagram of proposed strategy using perpendicular bisectors

Now I only need to check if the intersection point is close.

How can I check if they intersect? Or is there a better way to solve this?

Here's my code so far:

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Source Link
OC_RaizW
  • 1.5k
  • 8
  • 27
  • 49

How can I detect if I move circular with my Gameobject?

I want to detect if my Gameobject (Vector3 Point) is moving circular. For that i thought its a good idea to safe the last 5 Points every 10 frames and make line-Vectors out of it.

Then I thought I project them into a "defined" Plane. And then I thought I have Floating Vectors - now i thought I check the perpendicular normals of those vectors - check where they are intersecting. If every intersection point is very nearby - the finger is Circulating!

enter image description here

Now I only need to check if the intersection point is close. How can I check if they intersect?

And am I even doing this right?

public LinkedList<Vector3> FingertipPoints; public Transform Fingertip; private void Start() { FingertipPoints = new LinkedList<Vector3>(); FingertipPoints.AddFirst(new Vector3(0, 0, 0)); FingertipPoints.AddLast(new Vector3(0, 0, 0)); FingertipPoints.AddLast(new Vector3(0, 0, 0)); FingertipPoints.AddLast(new Vector3(0, 0, 0)); FingertipPoints.AddLast(new Vector3(0, 0, 0)); } [Range(1,60)] public int FramesPerCheck = 10; // 6checks per sec private int Frame; // Update is called once per frame void LateUpdate() { Frame++; if (FramesPerCheck == Frame) { Frame = 0; FingertipPoints.RemoveLast(); FingertipPoints.AddFirst(Fingertip.position); } //Get the Direction Vectors Vector3 V1 = FingertipPoints.First.Value - FingertipPoints.First.Next.Value; Vector3 V2 = FingertipPoints.First.Next.Value - FingertipPoints.First.Next.Next.Value; Vector3 V3 = FingertipPoints.First.Next.Next.Value - FingertipPoints.First.Next.Next.Next.Value; Vector3 V4 = FingertipPoints.First.Next.Next.Next.Value - FingertipPoints.Last.Value; //Project them on a plane V1 = Vector3.ProjectOnPlane(V1, Fingertip.forward); V2 = Vector3.ProjectOnPlane(V2, Fingertip.forward); V3 = Vector3.ProjectOnPlane(V3, Fingertip.forward); V4 = Vector3.ProjectOnPlane(V4, Fingertip.forward); //Get the Perpendicular Vectors (is this even right?) Vector3 C1 = Vector3.Cross(V1, Fingertip.forward); Vector3 C2 = Vector3.Cross(V1, Fingertip.forward); Vector3 C3 = Vector3.Cross(V1, Fingertip.forward); Vector3 C4 = Vector3.Cross(V1, Fingertip.forward); //??? //How to check if they intersect nearby?? // }