@@ -276,6 +276,7 @@ void setFrustum(IceTDouble * const projection, const isaac_float left,const isaa
276276 projection[14 ] = ( -znear2 * zfar ) / -zRange;
277277 projection[15 ] = isaac_float ( 0 );
278278}
279+
279280void setPerspective (IceTDouble * const projection, const isaac_float fovyInDegrees,const isaac_float aspectRatio,const isaac_float znear,const isaac_float zfar )
280281{
281282 isaac_float ymax = znear * tan ( fovyInDegrees * M_PI / isaac_float (360 ) );
@@ -294,6 +295,29 @@ void spSetPerspectiveStereoscopic( IceTDouble * const projection, const isaac_fl
294295 projection[12 ] += distance;
295296}
296297
298+
299+ void setOrthographic (IceTDouble * const projection, const isaac_float right,const isaac_float top,const isaac_float znear,const isaac_float zfar )
300+ {
301+ projection[ 0 ] = 1.0 / right;
302+ projection[ 1 ] = isaac_float ( 0 );
303+ projection[ 2 ] = isaac_float ( 0 );
304+ projection[ 3 ] = isaac_float ( 0 );
305+ projection[ 4 ] = isaac_float ( 0 );
306+ projection[ 5 ] = 1.0 / top;
307+ projection[ 6 ] = isaac_float ( 0 );
308+ projection[ 7 ] = isaac_float ( 0 );
309+ projection[ 8 ] = isaac_float ( 0 );
310+ projection[ 9 ] = isaac_float ( 0 );
311+ projection[10 ] = -2.0 / (zfar-znear);
312+ projection[11 ] = isaac_float ( 0 );
313+ projection[12 ] = isaac_float ( 0 );
314+ projection[13 ] = isaac_float ( 0 );
315+ projection[14 ] = - (zfar+znear) / (zfar-znear);
316+ projection[15 ] = isaac_float ( 1 );
317+ }
318+
319+
320+
297321#if ISAAC_VALGRIND_TWEAKS == 1
298322 static void *extra_malloc (size_t size)
299323 {
0 commit comments