+}
+
+Mat4 OrbitCamera::get_view_matrix() const
+{
+ Mat4 view_matrix;
+ view_matrix.translation(-position);
+ view_matrix.rotate_y(theta * (float)M_PI / 180);
+ view_matrix.rotate_x(phi * (float)M_PI / 180);
+ view_matrix.translate(Vec3(0, 0, -distance));
+
+ return view_matrix;
+}
+
+Mat4 calc_projection_matrix(float fov_deg, float aspect, float n, float f)
+{
+ float fov = fov_deg / 180 * M_PI;
+
+ float tmp;
+ tmp = 1 / tan(fov / 2.0);