MCPcopy
hub / github.com/aosabook/500lines / push

Method push

modeller/code/trackball.py:195–214  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

193
194
195 def push(self):
196 viewport = gl.glGetIntegerv(gl.GL_VIEWPORT)
197 gl.glMatrixMode(gl.GL_PROJECTION)
198 gl.glPushMatrix()
199 gl.glLoadIdentity ()
200 aspect = viewport[2]/float(viewport[3])
201 aperture = 35.0
202 near = 0.1
203 far = 100.0
204 top = math.tan(aperture*3.14159/360.0) * near * self._zoom
205 bottom = -top
206 left = aspect * bottom
207 right = aspect * top
208 gl.glFrustum (left, right, bottom, top, near, far)
209 gl.glMatrixMode (gl.GL_MODELVIEW)
210 gl.glPushMatrix()
211 gl.glLoadIdentity ()
212 # gl.glTranslate (0.0, 0, -self._distance)
213 gl.glTranslate (self._x, self._y, -self._distance)
214 gl.glMultMatrixf (self._matrix)
215
216 def pop(void):
217 gl.glMatrixMode(gl.GL_MODELVIEW)

Callers 15

FaFunction · 0.45
highcharts.jsFile · 0.45
cWFunction · 0.45
cYFunction · 0.45
jquery.min.jsFile · 0.45
bcFunction · 0.45
bhFunction · 0.45
bkFunction · 0.45
bmFunction · 0.45
gFunction · 0.45
AFunction · 0.45
blockScriptFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected