source: src/models/Camera.pym @ 1345:ff8ef9c6bbb7

Revision 1345:ff8ef9c6bbb7, 1.9 KB checked in by Arc Riley <arcriley@…>, 4 years ago (diff)

Happy New Year! (copyright string update)

RevLine 
[1045]1# PySoy's models.Camera class
[850]2#
[1345]3# Copyright (C) 2006,2007,2008,2009 PySoy Group
[850]4#
5#  This program is free software; you can redistribute it and/or modify
[1212]6#  it under the terms of the GNU Affero General Public License as published
7#  by the Free Software Foundation, either version 3 of the License, or
[850]8#  (at your option) any later version.
9#
10#  This program is distributed in the hope that it will be useful,
11#  but WITHOUT ANY WARRANTY; without even the implied warranty of
12#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
[1212]13#  GNU Affero General Public License for more details.
[850]14#
[1212]15#  You should have received a copy of the GNU Affero General Public License
[850]16#  along with this program; if not, see http://www.gnu.org/licenses
17#
[1345]18# $Id: Camera.pym 1393 2008-12-31 23:51:25Z ArcRiley $
[850]19
[738]20cdef class Camera(Mesh) :
[1045]21  '''soy.models.Camera
[850]22
[1045]23    This class renders a "camera", intended for debugging purposes.
24  '''
25
26
27  ############################################################################
28  #
29  # WindowLoop Functions
30  #
31
[1212]32  cdef void _render(self, soy.bodies.Body _body) :
[738]33    gl.glPushMatrix()
34    gl.glScalef(0.1,0.1,0.1)
35    gl.glDisable(gl.GL_CULL_FACE)
36    gl.glDisable(gl.GL_DEPTH_TEST)
37    gl.glDisable(gl.GL_LIGHTING)
38    gl.glColor3f(0.5,0.5,0.5)
39    gl.glBegin(gl.GL_LINE_STRIP)
40    gl.glVertex3f(-1,1.,1.)
41    gl.glVertex3f(1,1.,1.)
42    gl.glVertex3f(1,-1.,1.)
[850]43    gl.glVertex3f(-1,-1.,1.)   
[738]44    gl.glEnd()
45    gl.glColor3f(0.5,0.5,0.5)
[850]46    gl.glBegin(gl.GL_LINES)   
[738]47    gl.glVertex3f(-1,1.,1.)
48    gl.glVertex3f(0,0,0)
49    gl.glVertex3f(1,1.,1.)
50    gl.glVertex3f(0,0,0)
51    gl.glVertex3f(-1,-1.,1.)
52    gl.glVertex3f(0,0,0)
53    gl.glVertex3f(1,-1.,1.)
54    gl.glVertex3f(0,0,0)
55    gl.glVertex3f(-1,-1.,1.)
56    gl.glVertex3f(-1,1.,1.)
57    gl.glEnd()
58    gl.glEnable(gl.GL_LIGHTING)
59    gl.glEnable(gl.GL_DEPTH_TEST)
60    gl.glEnable(gl.GL_CULL_FACE)
[850]61    gl.glPopMatrix()
Note: See TracBrowser for help on using the repository browser.