Module Camera
[hide private]
[frames] | no frames]

Source Code for Module Camera

 1  #####################################################################
 
 2  # -*- coding: iso-8859-1 -*-                                        #
 
 3  #                                                                   #
 
 4  # Frets on Fire                                                     #
 
 5  # Copyright (C) 2006 Sami Kyöstilä                                  #
 
 6  #                                                                   #
 
 7  # This program is free software; you can redistribute it and/or     #
 
 8  # modify it under the terms of the GNU General Public License       #
 
 9  # as published by the Free Software Foundation; either version 2    #
 
10  # of the License, or (at your option) any later version.            #
 
11  #                                                                   #
 
12  # This program is distributed in the hope that it will be useful,   #
 
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of    #
 
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     #
 
15  # GNU General Public License for more details.                      #
 
16  #                                                                   #
 
17  # You should have received a copy of the GNU General Public License #
 
18  # along with this program; if not, write to the Free Software       #
 
19  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,        #
 
20  # MA  02110-1301, USA.                                              #
 
21  #####################################################################
 
22  
 
23  from OpenGL.GLU import * 
24  
 
25 -class Camera:
26 - def __init__(self):
27 # Camera origin vector 28 self.origin = (10.0, 0.0, 10.0) 29 # Camera target vector 30 self.target = (0.0, 0.0, 0.0) 31 # Camera up vector 32 self.up = (0.0, 1.0, 0.0)
33
34 - def apply(self):
35 """Load the camera matrix.""" 36 gluLookAt(self.origin[0], self.origin[1], self.origin[2], 37 self.target[0], self.target[1], self.target[2], 38 self.up[0], self.up[1], self.up[2])
39