diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index f8447a0d6..a7ff89a70 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -1518,9 +1518,9 @@ typedef void (* GLFWjoystickfun)(int,int); * @param[in] y pen position relative to the screen. * @param[in] z pen position relative to the tablet. * @param[in] pen pressure from 0.0 to 1.0. - * @param[in] pen pitch in degree. - * @param[in] pen yaw in degree. - * @param[in] pen roll in degree. + * @param[in] pen pitch in radian. + * @param[in] pen yaw in radian. + * @param[in] pen roll in radian. * * @sa @ref pen_tablet_data * @sa @ref glfwSetPenTabletDataCallback diff --git a/src/win32_window.c b/src/win32_window.c index 038418ee3..edc8e4c95 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -639,13 +639,13 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, x = ((double)(packet.x - contextInfo.lcInOrgX) / contextInfo.lcInExtX) * contextInfo.lcSysExtX + contextInfo.lcSysOrgX; y = ((double)(packet.y - contextInfo.lcInOrgY) / contextInfo.lcInExtY) * contextInfo.lcSysExtY + contextInfo.lcSysOrgY; - z = ((double)(packet.z - contextInfo.lcOutOrgZ) / contextInfo.lcOutExtZ); + z = packet.z / 1024.0; pressure = (double)(packet.normalPressure - pressureInfo.min) / (pressureInfo.max - pressureInfo.min); if (aziInfo.resolution && altInfo.resolution) { double alt = (double)(packet.orientation.altitude - altInfo.min) / (altInfo.max - altInfo.min); double azi = (double)(packet.orientation.azimuth - aziInfo.min) / (aziInfo.max - aziInfo.min); - pitch = (0.5 - alt) * 180.0; - yaw = azi * 360.0; + pitch = alt * 3.14159265359; + yaw = azi * 6.28318530718; } if (rollInfo.resolution) { // roll seems to be mostly unsupported so this is untested roll = (double)(packet.orientation.twist - rollInfo.min) / (rollInfo.max - rollInfo.min) * 360.0;