Mercurial > touhou
changeset 11:548662d70860
Add some explanations to the magic constants
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Wed, 03 Aug 2011 15:25:26 +0200 |
parents | 059ea0ea8d38 |
children | 776453783743 |
files | stageviewer.py |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/stageviewer.py +++ b/stageviewer.py @@ -262,6 +262,11 @@ def main(path, stage_num): glMatrixMode(GL_MODELVIEW) glLoadIdentity() + # Some explanations on the magic constants: + # 192. = 384. / 2. = width / 2. + # 224. = 448. / 2. = height / 2. + # 835.979370 = 224./math.tan(math.radians(15)) = (height/2.)/math.tan(math.radians(fov/2)) + # This is so that objects on the (O, x, y) plane use pixel coordinates gluLookAt(192., 224., - 835.979370 * dz, 192., 224. - dy, 750 - 835.979370 * dz, 0., -1., 0.) #TODO: 750 might not be accurate #print(glGetFloat(GL_MODELVIEW_MATRIX)) @@ -269,6 +274,11 @@ def main(path, stage_num): glDrawArrays(GL_QUADS, 0, nb_vertices) + #TODO: show the game itself + # It is displayed on (0, 0, 0), (0, 448, 0), (388, 448, 0), (388, 0, 0) + # using a camera at (192, 224, -835.979370) looking right behind itself + # Depth test should be disabled when rendering the game + pygame.display.flip() clock.tick(120) frame += 1