def __init__(self, width=None, height=None): self.position = Vector3() self.target = Vector3(0.0, 0.0, 1.0) self.up = Vector3.up() self.width = width self.height = height self.aspectRatio = None
def rotationMatrix(self): w = self.target.normalize() u = Vector3.cross(Vector3.up().normalize(), w) v = Vector3.cross(w, u) rotMat = np.matrix([[u.x, u.y, u.z, 0.0], [v.x, v.y, v.z, 0.0], [w.x, w.y, w.z, 0.0 ], [0.0, 0.0, 0.0, 1.0]], dtype=np.float32) return rotMat