예제 #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)
예제 #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)
예제 #3
0
 def test_ray_originates_on_sphere(self):
     test_no_intersection(self.sphere, origin=[1, 0, 0], direction=[1, 0, 0])
예제 #4
0
 def test_no_intersection_miss_v1(self):
     test_no_intersection(self.sphere, origin=[0, 0, 10], direction=[5, 0, -10])
예제 #5
0
 def test_ray_originates_on_sphere(self):
     test_no_intersection(self.sphere, origin=[1, 0, 0], direction=[1, 0, 0])
예제 #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)
예제 #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)
예제 #8
0
 def test_no_intersection_miss_v1(self):
     origin = [0, 10, 10]
     direction = [5, 0, -10]
     test_no_intersection(self.box, origin, direction)
예제 #9
0
 def test_no_intersection_miss_v1(self):
     origin = [0, 10, 10]
     direction = [5, 0, -10]
     test_no_intersection(self.plane, origin, direction)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #17
0
 def test_no_intersection_miss_v0(self):
     origin = [0, 10, 0]
     direction = [1, 0, 0]
     test_no_intersection(self.box, origin, direction)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #22
0
 def test_no_intersection_miss_v0(self):
     origin = [0, 0, 10]
     direction = [1, 0, 0]
     test_no_intersection(self.sphere, origin, direction)
예제 #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)
예제 #24
0
 def test_no_intersection_miss_v1(self):
     test_no_intersection(self.sphere, origin=[0, 0, 10], direction=[5, 0, -10])