sadmb / ofxKinectNui

Kinect SDK 1.0 or higher addon for openFrameworks
46 stars 31 forks source link

Array access bug in getWorldCoordinateFor(...) #11

Closed lucieb closed 11 years ago

lucieb commented 12 years ago

The function getWorldCoordinateFor(...) located in ofxKinectNui.cpp is accessing the wrong depth pixel.

At the moment, the function is:

ofVec3f ofxKinectNui::getWorldCoordinateFor(int depthX, int depthY){ const double depthZ = distancePixels[depthWidth * depthX + depthY]/1000.0; return ofxBase3DVideo::getWorldCoordinateFor(depthX, depthY, depthZ); }

but it should be

ofVec3f ofxKinectNui::getWorldCoordinateFor(int depthX, int depthY){ const double depthZ = distancePixels[depthWidth * depthY + depthX]/1000.0; /// <----- Need to invert depthX and depthY return ofxBase3DVideo::getWorldCoordinateFor(depthX, depthY, depthZ); }

sadmb commented 12 years ago

Thx, @lucieb It's a great help! : ) worldcoordinatefor is one of the issue that i have to complete. ; ) I will check it and implement asap!

sadmb commented 11 years ago

@lucieb I have fixed. : ) Thanks for your advise.