Mercurial > touhou
diff stageviewer.py @ 45:e01e88b06a13
Fix camera handling, should be much closer to the original, now
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Mon, 22 Aug 2011 09:11:16 +0200 |
parents | a10e3f44a883 |
children | ab826bc29aa2 |
line wrap: on
line diff
--- a/stageviewer.py +++ b/stageviewer.py @@ -76,7 +76,7 @@ def main(path, stage_num): fog_b, fog_g, fog_r, _, fog_start, fog_end = background.fog_interpolator.values x, y, z = background.position_interpolator.values - unknownx, dy, dz = background.position2_interpolator.values + dx, dy, dz = background.position2_interpolator.values glFogi(GL_FOG_MODE, GL_LINEAR) glFogf(GL_FOG_START, fog_start) @@ -92,7 +92,7 @@ def main(path, stage_num): # 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 + 192. + dx, 224. - dy, 0., 0., -1., 0.) #print(glGetFloat(GL_MODELVIEW_MATRIX)) glTranslatef(-x, -y, -z)