Stationary Body Tracking

Hi, I am currently developing a game within Unity using Nuitrack with an Orbbec Astra camera. As part of the game the character (overall body) needs to remain in a constant position whilst being able to detect and show the relative movement of each of the characters limbs. I have been following the ‘Animating an Avatar using Skeleton’ tutorial (https://github.com/3DiVi/nuitrack-sdk/blob/master/doc/Unity_Avatar_Animation.md) however this leads to the creation of an avatar which changes position based on the users position within the camera’s frame. Any advice on how to adapt my code to achieve this would be greatly appreciated

Hello @bspriggs
Just remove this lines

Hi @Stepan.Reuk,

Thanks for your help! Unfortunately I am following the Direct Mapping method outlined within the tutorial and as a result the lines of code you identified have already been removed and replaced, hence I am unsure how to edit my code to achieve the same outcome? Any suggestions would be really appreciated

I am still struggling with this issue and wondered if anyone would be able to provide me with some assistance?

Thanks in advance!

@bspriggs

You can simply add a offset to the positions of the joints using, for example, the coordinates of the waist joint

@Stepan.Reuk - this was my initial idea for approaching the problem, however I can’t work out how to implement it. Would you be able to attach some sample code outlining how you would approach this?

@bspriggs

Add fields:

[SerializeField] nuitrack.JointType fixedJoint = nuitrack.JointType.Waist;
Vector3 offset;
Vector3 startJointPosition;

Save start joint position in Start

Update offset in your processing skeleton method. And subtract the offset from the position of each joint
image