# How to manually draw Yaw, Pitch, Roll vectors on each joint in the DrawBody method of BodyBasics-WPF

• ### General discussion

• Hi All,

Using BodyBasics-WPF as a jumping off point, I'm trying to manually draw the 3 vector RGB indicators on each joint similar to the image below.  Are there any samples that demonstrate calculating, then drawing this data?

Thanks for any help,

John

I think it should be something like...

//foreach joint, draw 3 lines that represent X,Y,Z in the JointOrientation Quaternion

//Convert the joint orientation quaternion to Euler Yaw Pitch Roll angles
CameraSpacePoint p = MathHelpers.QuaternionToEuler3(JointOrientations[jointType].Orientation);

//Do some math to derive each line's end point (X,Y,Z)

//Draw the lines from the joint to the DepthSpacePoint

//I am really not sure what depthSpacePoint below is pointing to but it shows the basic idea of converting from 3D space to 2D screen space then drawing.  I'm missing the math above for each vector.
//Convert the camera point to depth space point (X,Y)
DepthSpacePoint depthSpacePoint = this.coordinateMapper.MapCameraPointToDepthSpace(p);
drawingContext.DrawLine(newPen(Brushes.Blue, JointThickness), jointPoints[jointType], newPoint(depthSpacePoint.X, depthSpacePoint.Y));

This image is copied from a post within this forum regarding avateering in Unreal Engine 4.

Here is another video (posted by the lion03) that shows another great example of displaying joint orientations visually.  http://youtu.be/1X_HC_j60r8

Monday, September 29, 2014 4:23 PM

### All replies

• Hi All,

I put together a demo application that provides this information.  I'm not positive the math is correct but it looks promising.

Here is the source code:
Source Code on github

Here is a video demo: