Ejemplo n.º 1
0
 def setUp(self):
   super(TriangleRasterizerTest, self).setUp()
   camera_origin = (0.0, 0.0, 0.0)
   camera_up = (0.0, 1.0, 0.0)
   look_at = (0.0, 0.0, 1.0)
   field_of_view = (60 * np.math.pi / 180,)
   height = 3.0
   width = 5.0
   near_plane = 0.01
   far_plane = 400.0
   image_size = (height, width)
   self.image_size_int = (int(height), int(width))
   bottom_left = (0.0, 0.0)
   self.triangle_size = 1000
   background_geometry = np.array(
       ((-self.triangle_size, self.triangle_size, far_plane - 10.0),
        (self.triangle_size, self.triangle_size, far_plane - 10.0),
        (0.0, -self.triangle_size, far_plane - 10.0)),
       dtype=np.float32)
   background_attribute = np.array(
       ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0)), dtype=np.float32)
   background_triangle = np.array((0, 1, 2), np.int32)
   self.rasterizer = triangle_rasterizer.TriangleRasterizer(
       background_geometry, background_attribute, background_triangle,
       camera_origin, look_at, camera_up, field_of_view, image_size,
       (near_plane,), (far_plane,), bottom_left)
Ejemplo n.º 2
0
def _proxy_rasterizer(background_vertices, background_attributes,
                      background_triangles, camera_origin, look_at, camera_up,
                      field_of_view, near_plane, far_plane, bottom_left):
  return triangle_rasterizer.TriangleRasterizer(
      background_vertices, background_attributes, background_triangles,
      camera_origin, look_at, camera_up, field_of_view, (4, 3), near_plane,
      far_plane, bottom_left)