Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有多个输入设备,我想为每个输入设备创建一个光标。我得到了 x 和 y 坐标,我想在屏幕上绘制它。
使用 glTranslatef 时如何计算 x,y?
我很确定,除非我患有严重的精神失常,否则情况如下:
float fX = ((float)(x * 2) / (float)screenWidth) - 1.0f) float fY = ((float)(-y * 2) / (float)screenHeight) - 1.0f)