2017-08-27 12:51:26 +02:00
|
|
|
import numpy as np
|
|
|
|
import typing
|
2020-07-19 10:41:08 +02:00
|
|
|
|
|
|
|
|
2017-08-27 12:51:26 +02:00
|
|
|
class Object:
|
|
|
|
GeometryShaderId = -1
|
2020-07-19 10:41:08 +02:00
|
|
|
|
|
|
|
def draw(self) -> bool:
|
2017-08-27 12:51:26 +02:00
|
|
|
return False
|
2020-07-19 10:41:08 +02:00
|
|
|
|
|
|
|
def initializeShader(self) -> bool:
|
2017-08-27 12:51:26 +02:00
|
|
|
return True
|
2020-07-19 10:41:08 +02:00
|
|
|
|
2017-08-27 12:51:26 +02:00
|
|
|
def __init__(self):
|
|
|
|
self.pos = np.zeros((3))
|
2017-10-21 11:10:00 +02:00
|
|
|
self.color = np.zeros((3,))
|
2017-08-27 12:51:26 +02:00
|
|
|
self.programmId = -1
|
2020-07-19 10:41:08 +02:00
|
|
|
|
|
|
|
def translate(self, M):
|
|
|
|
self.pos = np.array((np.concatenate((self.pos, [1])) * M)[0, 0:3])[0]
|
2017-10-21 11:10:00 +02:00
|
|
|
return self
|
2020-07-19 10:41:08 +02:00
|
|
|
|
|
|
|
def setColor(self, R, G, B):
|
2017-10-21 11:10:00 +02:00
|
|
|
self.color[0] = R
|
|
|
|
self.color[1] = G
|
|
|
|
self.color[2] = B
|
2020-07-19 10:41:08 +02:00
|
|
|
return self
|