我怎样才能像在 2D 游戏中那样做坐标(所以 X = 0 Y = 0 在右上角)?左边是这样的:
问问题
333 次
1 回答
1
You simply have to use some formulas to convert between the two coordinate systems.
openGL_x = (screen_x - width/2)/(width/2) == a*x + b;
openGL_y = (height/2 - screenY)/(height/2) == c*y + d;
With openGL you can embed these two linear equations into the ViewMatrix and work with pixel coordinates.
于 2012-12-22T10:05:44.230 回答