comparison pytouhou/ui/gamerenderer.py @ 412:5fe6cd6ceb48

Refactor the maths functions out of Renderer.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 12 Jun 2013 18:30:08 +0200
parents 705870483559
children 52829ebe2561
comparison
equal deleted inserted replaced
411:2428296cccab 412:5fe6cd6ceb48
20 GL_DEPTH_BUFFER_BIT, GL_PROJECTION, GL_MODELVIEW, 20 GL_DEPTH_BUFFER_BIT, GL_PROJECTION, GL_MODELVIEW,
21 GL_FOG, GL_FOG_MODE, GL_LINEAR, GL_FOG_START, 21 GL_FOG, GL_FOG_MODE, GL_LINEAR, GL_FOG_START,
22 GL_FOG_END, GL_FOG_COLOR, GL_COLOR_BUFFER_BIT, GLfloat) 22 GL_FOG_END, GL_FOG_COLOR, GL_COLOR_BUFFER_BIT, GLfloat)
23 23
24 from pytouhou.utils.matrix import Matrix 24 from pytouhou.utils.matrix import Matrix
25 from pytouhou.utils.maths import setup_camera
25 26
26 from .renderer import Renderer 27 from .renderer import Renderer
27 28
28 29
29 30
82 fog_start -= 101010101./2010101. 83 fog_start -= 101010101./2010101.
83 fog_end -= 101010101./2010101. 84 fog_end -= 101010101./2010101.
84 85
85 model = Matrix() 86 model = Matrix()
86 model.data[3] = [-x, -y, -z, 1] 87 model.data[3] = [-x, -y, -z, 1]
87 view = self.setup_camera(dx, dy, dz) 88 view = setup_camera(dx, dy, dz)
88 model_view_projection = model * view * self.proj 89 model_view_projection = model * view * self.proj
89 mvp = model_view_projection.get_c_data() 90 mvp = model_view_projection.get_c_data()
90 91
91 if self.use_fixed_pipeline: 92 if self.use_fixed_pipeline:
92 glMatrixMode(GL_MODELVIEW) 93 glMatrixMode(GL_MODELVIEW)