# Floorplane detection

Right now I’m looking at joint data and Ankles are in negative y, Shoulders in position y. Is there any kind of floorplane detection/compensation in the SDK?

Just nudging this in hopes of an answer.

Hi elsocko,

Yes, there is floorplane detection in Nuitrack SDK. Please, take a look at the `UserFrame` class reference in the Nuitrack documentation: http://download.3divi.com/Nuitrack/doc/classtdv_1_1nuitrack_1_1UserFrame.html (see the `getFloor` and `getFloorNormal` methods).

How can I get the joint data in “camera to world” space, with the floor being floor == 0?

Hi elsocko,

Let us assume that p is a 3D point returned by the `getFloor` method, n is a normal vector returned by the `getFloorNormal` method. Thus, n and p define the floor plane in camera coordinate space.

Let us assume that h is a 3D point (joint position), for which we should compensate the floor. Then,

1. Find the rotation matrix R, which transforms the n vector to the (0, 1, 0) vector (y-direction in camera coordinate space).
2. Apply the rotation to the 3D points p and h, we get the points R*p and R*h.
3. Subtract the y coordinate of the R*p point: R*h[y] - R*p[y]