Fiddling around with lighting and a Rendermanager
This commit is contained in:
parent
b5ec100c9c
commit
325da79fac
3 changed files with 37 additions and 5 deletions
|
@ -12,6 +12,7 @@ from MatrixStuff.Transformations import *
|
|||
class LightingManager:
|
||||
def __init__(self):
|
||||
self.Lights = []
|
||||
self.StructureSteps = []
|
||||
self.renderSteps = []
|
||||
|
||||
def addLight(self,l):
|
||||
|
|
|
@ -40,9 +40,35 @@ class Light:
|
|||
|
||||
|
||||
def __init__(self):
|
||||
self.ModelviewProjectionMatrix = np.identity(4)
|
||||
self._ModelviewProjectionMatrix = np.identity(4)
|
||||
self._pos = [0,0,0]
|
||||
self._lightColor = [1,1,1]
|
||||
self.FramebufferId = -1
|
||||
self.DepthBuffer = -1
|
||||
|
||||
@property
|
||||
def lightColor(self):
|
||||
return self._lightColor
|
||||
@lightColor.setter
|
||||
def lightColor(self,value):
|
||||
self._lightColor = value
|
||||
|
||||
@property
|
||||
def ModelviewProjectionMatrix(self):
|
||||
return self._ModelviewProjectionMatrix
|
||||
|
||||
@ModelviewProjectionMatrix.setter
|
||||
def ModelviewProjectionMatrix(self, value):
|
||||
self._ModelviewProjectionMatrix = np.matrix(value)
|
||||
|
||||
@property
|
||||
def pos(self):
|
||||
return self._pos
|
||||
|
||||
@pos.setter
|
||||
def pos(self,value):
|
||||
self._pos = value
|
||||
|
||||
def prepareForDepthMapping(self):
|
||||
new = False
|
||||
if self.FramebufferId == -1:
|
||||
|
@ -71,4 +97,5 @@ class Light:
|
|||
DrawBuffers = [GL_COLOR_ATTACHMENT0]
|
||||
glDrawBuffers(DrawBuffers)
|
||||
glClearColor(0.0, 0.0, 0.0, 1.0)
|
||||
glBindFramebuffer(GL_FRAMEBUFFER,0)
|
||||
glBindFramebuffer(GL_FRAMEBUFFER,0)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue