-
Notifications
You must be signed in to change notification settings - Fork 2
/
skyboxtest.py
43 lines (37 loc) · 1.53 KB
/
skyboxtest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- coding: utf-8 -*-
###################################################################
## this module is the main one, which contains the game class
###################################################################
from direct.showbase.ShowBase import ShowBase
from pandac.PandaModules import * #Load all PandaModules
import os.path
# -----------------------------------------------------------------
# -----------------------------------------------------------------
# -----------------------------------------------------------------
class Game(ShowBase):
'''
'''
def __init__(self, *args):
'''
'''
ShowBase.__init__(self)
base.setBackgroundColor(0,0,0)
self.mdl = self.loader.loadModel("data/models/vehicles/vehicle01.egg")
self.mdl.reparentTo(render)
#Add the Skybox
self.skybox = self.loader.loadModel("data/models/skybox.egg")
t = Texture()
#t.load(PNMImage("../skybox/skybox_tronic.png"))
t.load(PNMImage("../skybox/test.png"))
self.skybox.setTexture(t)
self.skybox.setBin("background", 1)
self.skybox.setDepthWrite(0)
self.skybox.setDepthTest(0)
self.skybox.setLightOff()
self.skybox.setScale(10000)
self.skybox.reparentTo(render)
# -----------------------------------------------------------------
# -----------------------------------------------------------------
# -----------------------------------------------------------------
game = Game()
game.run()