I have a PS4 game controller, and I can now read data from it using HID, including 6 axes as shown in the image below.
Three axes represent acceleration, and the other three represent angular rate.
With this data, I should be able to visualize the actual posture of the controller using a 3D model in WPF. Currently, I found that the "3D Controller Overlay" feature in Steam perfectly achieves the effect I desire. Is there any library or framework available to help achieve this effect?

In the end, I found this solution which perfectly solved my problem. Create a instance of
MadgwickAHRS, then callUpdateto update the six-axis data, and finally obtain a quaternion for rotation. The specific code is as follows: