MARMOTatZJU / GAMES101-HW

Homework repo. for GAMES-101: https://sites.cs.ucsb.edu/~lingqi/teaching/games101.html
63 stars 19 forks source link

冒昧的问一句,请问这个是被批改过的作业吗 #3

Closed dingyalei closed 2 years ago

dingyalei commented 3 years ago

RT

MARMOTatZJU commented 3 years ago

是的,我参与了GAMES101第一期课程。

yongbaoXu commented 3 years ago

请问,计算x和y的坐标时, y = (float) (scene.height-1 - j) / scene.height - 0.5; y值的公式为什么不是 y = (float) j / scene.height - 0.5; 呢?有些不懂~ 谢谢~

MARMOTatZJU commented 3 years ago

请问,计算x和y的坐标时, y = (float) (scene.height-1 - j) / scene.height - 0.5; y值的公式为什么不是 y = (float) j / scene.height - 0.5; 呢?有些不懂~ 谢谢~

因为y轴方向是从下到上,j轴方向是从上到下。