• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Detect 3D path irrespective of position, scale, and rotation

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1timeslider  Members

Posted 05 May 2014 - 03:07 PM

Hello,

I'm trying to develop a way to detect if the player has flown in a certain path and position, scale, and rotation doesn't matter. For a basic example of what I mean, say the player has to fly in a circle. I want it to detect and return true if the player flew in a small circle, a big circle, parallel to the ground or completely sideways or any other type of circle you could imagine. It wouldn't have to be perfect either as long as they roughly flew in the correct path. I'm just not sure how to go about it or if it's even possible. It's trivial to detect a particular shape because the XYZ coordinates are known but for this problem they'd be unknown.

I'm only looking for high level concepts/theory of how it might work, not exact implementation or just simply point me in the right direction.

Edit: I'm using the circle just as example. In practice, it would need to detect complex paths/shapes in 3D.

Thanks

### #2plainoldcj  Members

Posted 05 May 2014 - 04:31 PM

Considering the special case of a circle:

A circle can be defined by three different points. So maybe you could sample the last positions of the player

and then take a couple of 3-tuples and the corresponding circles and check how much they differ.

For that you can check (i) the distance between the centers (ii) the angle of the containing planes (iii) the differences of the radii

Note, however, that this approach only takes the positions into account. This would allow the player to change his orientation arbitrarily

while tracing a circle, for example.

### #3ferrous  Members

Posted 05 May 2014 - 04:59 PM

This sounds similar to penmanship/touch type stuff, you might look into handwriting recognition code or wii/sony move/kinect motion sensing stuff.  It might help give you ideas.

And yeah, my thought would be to sample the last X points, get a rough estimate of what plane the points all lie along, and then check if the points roughly form a circle, either maybe by looking at the angles the points form from each other.

### #4timeslider  Members

Posted 05 May 2014 - 10:21 PM

This sounds similar to penmanship/touch type stuff, you might look into handwriting recognition code or wii/sony move/kinect motion sensing stuff.  It might help give you ideas.

And yeah, my thought would be to sample the last X points, get a rough estimate of what plane the points all lie along, and then check if the points roughly form a circle, either maybe by looking at the angles the points form from each other.

Thanks for the advice, I didn't think about. I'll look into that.

### #5C0lumbo  Members

Posted 06 May 2014 - 01:14 AM

Yeah, as Ferrous basically said, I think gesture recognition is essentially the field of computer science that you're asking about, and there are several libraries out there that might help you. This one looks promising http://www.nickgillian.com/software/grt#Overview if you're OK with the MIT license (although I have never used it, so I'm not endorsing it).

Otherwise, I think you'll be writing lots of very ropey special case code to recognise each of the gestures/moves that you're interested in. If you went down this route, you might end up with a lot of ugly code, but it might be easier to debug and fine-tune than a trained neural net (which I believe is the normal approach for gesture recognition).

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.