标签: opengl mouseevent
我有多个输入设备,我想为每个设备创建一个游标。我给了x和y坐标,我想在屏幕上绘制它。
使用glTranslatef时如何计算x,y?
答案 0 :(得分:1)
我很确定,除非我遭受重大心灵失败,否则如下:
float fX = ((float)(x * 2) / (float)screenWidth) - 1.0f) float fY = ((float)(-y * 2) / (float)screenHeight) - 1.0f)