def _get_projection_matrix(window_size, view_position, view_zoom,
view_aperture, initial_view_aperture_x):
"""Retrieve the projection matrix."""
scale = 2.0 * view_zoom / initial_view_aperture_x
return (ctypes.c_float * 16)(
scale,
0.0,
0.0,
0.0,
0.0,
scale * window_size.x / window_size.y,
0.0,
0.0,
0.0,
0.0,
1.0,
0.0,
-2.0 * view_position.x / view_aperture.x,
-2.0 * view_position.y / view_aperture.y,
0.0,
1.0)
评论列表
文章目录