+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);
+
+ /* near - far clipping planes */
+ float range = n - f;
+
+ Mat4 pmat = Mat4(
+ tmp/aspect, 0, 0, 0,
+ 0, tmp, 0, 0,
+ 0, 0, (f + n) / range, -1,
+ 0, 0, 2 * n * f / range, 0
+ );
+
+ return pmat;
+}
+
+void OrbitCamera::set_position(float x, float y, float z)
+{
+ position.x = x;
+ position.y = y;
+ position.z = z;
+}
\ No newline at end of file