x


Find distance between two points on two objects

It's hard to explain my situation properly in the title but I'll try here. I am using the Microsoft kinect with Unity. I am creating a training game for Taekwondo. I have created a tool to recorded myself performing moves such as a kick or punch and then want to practice the move against the recording and it tells me if I did it correctly.

In order to achieve this I pick a key-frame such as an outstretched fist. I take the position(Vector3) of the fist which gets compared every update against the fist of the practising player and if it is within a small distance of each other we have a valid movement.(I know this is not the ideal way to do this but I want to keep it simple)

This should have been simple until I realised that the fist position is recorded in world space instead of local to the character space. This means that when I recorded the move I would be standing in a different place relative to the kinect than when the player is playing. The character also has a root point in world space.

I need to know can I use the root position and fist position of the pre-recorded comparison frame (both Vector3) and the root position and the position of the fist from the user and come up with a way to change both fist positions so they are relative to the character.

more ▼

asked Apr 23 '12 at 04:58 PM

ClearZ gravatar image

ClearZ
16 1 1 1

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x573
x353
x114

asked: Apr 23 '12 at 04:58 PM

Seen: 677 times

Last Updated: Apr 23 '12 at 04:58 PM