MCPcopy Create free account
hub / github.com/cinder/Cinder / setMatricesWindowPersp

Function setMatricesWindowPersp

src/cinder/gl/wrapper.cpp:577–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575}
576
577void setMatricesWindowPersp( int screenWidth, int screenHeight, float fovDegrees, float nearPlane, float farPlane, bool originUpperLeft )
578{
579 auto ctx = gl::context();
580
581 CameraPersp cam( screenWidth, screenHeight, fovDegrees, nearPlane, farPlane );
582 ctx->getModelMatrixStack().back() = mat4();
583 ctx->getProjectionMatrixStack().back() = cam.getProjectionMatrix();
584 ctx->getViewMatrixStack().back() = cam.getViewMatrix();
585 if( originUpperLeft ) {
586 ctx->getViewMatrixStack().back() *= glm::scale( vec3( 1, -1, 1 ) ); // invert Y axis so increasing Y goes down.
587 ctx->getViewMatrixStack().back() *= glm::translate( vec3( 0, (float) - screenHeight, 0 ) ); // shift origin up to upper-left corner.
588 }
589}
590
591void setMatricesWindowPersp( const ci::ivec2& screenSize, float fovDegrees, float nearPlane, float farPlane, bool originUpperLeft )
592{

Callers 10

drawMethod · 0.85
dilateVelocityMethod · 0.85
drawMethod · 0.85
drawMethod · 0.85
drawMethod · 0.85
drawMethod · 0.85
renderSceneToFboMethod · 0.85
drawBasicOverviewMethod · 0.85
drawSourcesStressTestMethod · 0.85
drawMethod · 0.85

Calls 4

backMethod · 0.80
contextFunction · 0.70
scaleFunction · 0.70
translateFunction · 0.70

Tested by

no test coverage detected