X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprojection.cpp;fp=source%2Fprojection.cpp;h=0000000000000000000000000000000000000000;hb=2997aeeea512437e8b8f61bef4cb329756888695;hp=dd573da443eb7bcf5a305690cd456a450886eff7;hpb=1ddd5b2a0c4ab104d90db427af0f24991fc40580;p=libs%2Fgl.git diff --git a/source/projection.cpp b/source/projection.cpp deleted file mode 100644 index dd573da4..00000000 --- a/source/projection.cpp +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include "matrix.h" -#include "projection.h" - -namespace Msp { -namespace GL { - -extern MatrixStack *active_stack; - -void ortho(double left, double right, double bottom, double top, double nearr, double farr) -{ - *active_stack *= Matrix::ortho(left, right, bottom, top, nearr, farr); -} - -void ortho_centered(double width, double height) -{ - ortho(-width/2, width/2, -height/2, height/2, 0, 1); -} - -void ortho_bottomleft(double width, double height) -{ - ortho(0, width, 0, height, 0, 1); -} - -void ortho_topleft(double width, double height) -{ - ortho(0, width, height, 0, 0, 1); -} - -void frustum(double left, double right, double bottom, double top, double nearr, double farr) -{ - *active_stack *= Matrix::frustum(left, right, bottom, top, nearr, farr); -} - -void frustum_centered(double width, double height, double nearr, double farr) -{ - frustum(-width/2, width/2, -height/2, height/2, nearr, farr); -} - -void perspective(double fov_y, double aspect, double nearr, double farr) -{ - double hh = tan(fov_y*M_PI/360)*nearr; - frustum(-hh*aspect, hh*aspect, -hh, hh, nearr, farr); -} - -} // namespace GL -} // namespace Msp