Exemplo n.º 1
0
    def test_eye_on_corner_viewing_away(self):
        origin = [0.5, 0.5, 0.5]
        direction = [1, 1, 1]
        test_no_intersection(self.box, origin, direction)

        direction = [1, 0, 0]
        test_no_intersection(self.box, origin, direction)

        direction = [0, 1, 0]
        test_no_intersection(self.box, origin, direction)

        direction = [0, 0, 1]
        test_no_intersection(self.box, origin, direction)
Exemplo n.º 2
0
 def test_eye_on_corner_viewing_away(self):
     origin = [0.5, 0.5, 0.5]
     direction = [1, 1, 1]
     test_no_intersection(self.box, origin, direction)
     
     direction = [1, 0, 0]
     test_no_intersection(self.box, origin, direction)
     
     direction = [0, 1, 0]
     test_no_intersection(self.box, origin, direction)
     
     direction = [0, 0, 1]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 3
0
 def test_ray_originates_on_sphere(self):
     test_no_intersection(self.sphere, origin=[1, 0, 0], direction=[1, 0, 0])
Exemplo n.º 4
0
 def test_no_intersection_miss_v1(self):
     test_no_intersection(self.sphere, origin=[0, 0, 10], direction=[5, 0, -10])
Exemplo n.º 5
0
 def test_ray_originates_on_sphere(self):
     test_no_intersection(self.sphere, origin=[1, 0, 0], direction=[1, 0, 0])
Exemplo n.º 6
0
 def test_eye_on_box_front_viewing_front(self):
     boxPoint = self.center
     boxPoint[2] = self.maxPoint[2]
     origin = boxPoint
     direction = [0, 0, 1]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 7
0
 def test_eye_on_box_bottom_viewing_down(self):
     boxBottomPoint = self.center
     boxBottomPoint[1] = self.minPoint[1]
     origin = boxBottomPoint
     direction = [0, -1, 0]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 8
0
 def test_no_intersection_miss_v1(self):
     origin = [0, 10, 10]
     direction = [5, 0, -10]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 9
0
 def test_no_intersection_miss_v1(self):
     origin = [0, 10, 10]
     direction = [5, 0, -10]
     test_no_intersection(self.plane, origin, direction)
Exemplo n.º 10
0
 def test_eye_on_box_back_viewing_back(self):
     boxPoint = self.center
     boxPoint[2] = self.minPoint[2]
     origin = boxPoint
     direction = [0, 0, -1]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 11
0
 def test_eye_on_box_front_viewing_front(self):
     boxPoint = self.center
     boxPoint[2] = self.maxPoint[2]
     origin = boxPoint
     direction = [0, 0, 1]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 12
0
 def test_eye_on_box_left_viewing_left(self):
     boxPoint = self.center
     boxPoint[0] = self.minPoint[0]
     origin = boxPoint
     direction = [-1, 0, 0]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 13
0
 def test_eye_on_box_bottom_viewing_down(self):
     boxBottomPoint = self.center
     boxBottomPoint[1] = self.minPoint[1]
     origin = boxBottomPoint
     direction = [0, -1, 0]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 14
0
 def test_eye_on_box_top_viewing_up(self):
     boxTopPoint = self.center
     boxTopPoint[1] = self.maxPoint[1]
     origin = boxTopPoint
     direction = [0, 1, 0]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 15
0
 def test_no_intersection_opposite(self):
     ''' intersection at negative distance '''
     origin = [0, 10, 0]
     direction = [0, 1, 0]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 16
0
 def test_eye_on_plane_viewing_away(self):
     origin = [0, 0, 10]
     direction = [0, 1, -10]
     test_no_intersection(self.plane, origin, direction)
Exemplo n.º 17
0
 def test_no_intersection_miss_v0(self):
     origin = [0, 10, 0]
     direction = [1, 0, 0]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 18
0
 def test_ray_on_plane(self):
     ''' the ray is entirely on the plane'''
     origin = [0, 0, 10]
     direction = [1, 0, -1]
     test_no_intersection(self.plane, origin, direction)
Exemplo n.º 19
0
 def test_eye_on_box_top_viewing_up(self):
     boxTopPoint = self.center
     boxTopPoint[1] = self.maxPoint[1]
     origin = boxTopPoint
     direction = [0, 1, 0]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 20
0
 def test_no_intersection_opposite(self):
     ''' intersection at negative distance '''
     origin = [0, 0, 10]
     direction = [0, 0, 1]
     test_no_intersection(self.sphere, origin, direction)
Exemplo n.º 21
0
 def test_eye_on_box_left_viewing_left(self):
     boxPoint = self.center
     boxPoint[0] = self.minPoint[0]
     origin = boxPoint
     direction = [-1, 0, 0]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 22
0
 def test_no_intersection_miss_v0(self):
     origin = [0, 0, 10]
     direction = [1, 0, 0]
     test_no_intersection(self.sphere, origin, direction)
Exemplo n.º 23
0
 def test_eye_on_box_back_viewing_back(self):
     boxPoint = self.center
     boxPoint[2] = self.minPoint[2]
     origin = boxPoint
     direction = [0, 0, -1]
     test_no_intersection(self.box, origin, direction)
Exemplo n.º 24
0
 def test_no_intersection_miss_v1(self):
     test_no_intersection(self.sphere, origin=[0, 0, 10], direction=[5, 0, -10])