Ejemplo n.º 1
0
 def getInitCameraUp(self):
     #va = self.getFocalPoint() - self.getInitPosition()
     va = self.getInitPosition() - self.getFocalPoint() # w
     vb = self.getZAxis() # up
     
     w = Utils.normalize(va) # w 
     u = Utils.normalize(numpy.cross(vb, w))
     v = numpy.cross(w, u)
     
     return v
Ejemplo n.º 2
0
 def randPickDirection(self):
     x = random.random()
     y = random.random()
     z = random.random()
     v = numpy.array([x, y, z], dtype=numpy.float32)
     v = Utils.normalize(v)
     return v
Ejemplo n.º 3
0
 def isOccluded(self, pt1, pt2):
     """To check if there is a object between pt1 and pt2
     
     Methods: isOccluded(pt1, pt2) -> isOccluded?
     """
     vd = pt2 - pt1
     tMax = Utils.norm2(vd)
     vd = Utils.normalize(vd)
     isIntersect, t = self.__intersect(pt1, vd, 0, tMax)
     return isIntersect