~crempp/psg/devel

« back to all changes in this revision

Viewing changes to src/GXEng/View.py

  • Committer: Administrator
  • Date: 2009-12-14 04:46:06 UTC
  • Revision ID: administrator@gauss-20091214044606-deet4mtmsh0rwz52
Broken!

* Organized code into modules but did not fix it to work. In order to do this I had to remove the gui directory so I can add the GUI directory in the next commit.
* Began work on skybox extension.

Chad

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from direct.showbase.DirectObject import DirectObject
 
2
from pandac.PandaModules import AmbientLight
 
3
from pandac.PandaModules import DirectionalLight
 
4
from pandac.PandaModules import Vec4
 
5
from Settings import GameSettings
 
6
import SkyBox
 
7
import CameraMgr
 
8
import Event
 
9
 
 
10
class GameView():
 
11
        """The main view class for graphics"""
 
12
        def __init__(self):
 
13
                print("Creating GameView")
 
14
                base.disableMouse()
 
15
                #res = GameSettings().getSetting('RESOLUTION').split()[0].split('x')
 
16
                #self.xRes = int(res[0])
 
17
                #self.yRes = int(res[1])
 
18
                
 
19
                self.sky = SkyBox.SkyBox(render)
 
20
                self.camera = CameraMgr.CameraManager()
 
21
                
 
22
        def light(self):
 
23
                aLight = AmbientLight('aLight')
 
24
                dLight = DirectionalLight('dLight')
 
25
                aLight.setColor( Vec4(.6, .7, .8, 1) )
 
26
                dLight.setColor( Vec4( 0.9, 0.8, 0.9, 1 ) )
 
27
                alNP = render.attachNewNode(aLight) 
 
28
                dlNP = render.attachNewNode(dLight)
 
29
                dlNP.setHpr(0, -45, 0)