2017-08-27 12:51:26 +02:00
|
|
|
from MatrixStuff.Transformations import *
|
2020-11-08 10:20:23 +01:00
|
|
|
from Objects.Identifiable import Identifiable
|
2017-08-27 12:51:26 +02:00
|
|
|
|
|
|
|
|
2020-11-08 10:20:23 +01:00
|
|
|
class Light(Identifiable):
|
2017-08-27 12:51:26 +02:00
|
|
|
programId = {}
|
|
|
|
depthshaderId = -1
|
|
|
|
|
2020-07-19 10:41:08 +02:00
|
|
|
def getDepthProgram(self, vertexshader=-1, geometryshader=-1):
|
2020-11-08 10:20:23 +01:00
|
|
|
pass
|
2017-08-27 12:51:26 +02:00
|
|
|
|
|
|
|
def __init__(self):
|
2020-11-08 10:20:23 +01:00
|
|
|
super(Light, self).__init__()
|
2017-12-09 11:27:23 +01:00
|
|
|
self._ModelviewProjectionMatrix = np.identity(4)
|
2020-07-19 10:41:08 +02:00
|
|
|
self._pos = [0, 0, 0]
|
|
|
|
self._lightColor = [1, 1, 1]
|
2017-08-27 12:51:26 +02:00
|
|
|
self.FramebufferId = -1
|
|
|
|
self.DepthBuffer = -1
|
2020-07-19 10:41:08 +02:00
|
|
|
self.map_size = 1024
|
2017-12-09 11:27:23 +01:00
|
|
|
|
|
|
|
@property
|
|
|
|
def lightColor(self):
|
|
|
|
return self._lightColor
|
2020-07-19 10:41:08 +02:00
|
|
|
|
2017-12-09 11:27:23 +01:00
|
|
|
@lightColor.setter
|
2020-07-19 10:41:08 +02:00
|
|
|
def lightColor(self, value):
|
2017-12-09 11:27:23 +01:00
|
|
|
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
|
2020-07-19 10:41:08 +02:00
|
|
|
def pos(self, value):
|
2017-12-09 11:27:23 +01:00
|
|
|
self._pos = value
|
|
|
|
|
2017-08-27 12:51:26 +02:00
|
|
|
def prepareForDepthMapping(self):
|
2020-11-08 10:20:23 +01:00
|
|
|
pass
|
2017-08-27 12:51:26 +02:00
|
|
|
|
|
|
|
def finishDepthMapping(self):
|
2020-11-08 10:20:23 +01:00
|
|
|
pass
|