📄 projector.cpp
字号:
#include "stdafx.h"
#include "Projector.h"
void CProjector::computeTextureProjection( const SMatrix4x4& projectorMatrix, SMatrix4x4& dest )
{
const CRenderCamera& camera = G_RENDERCTX->getCamera();
// | -0.5 0 0 0 |
// | 0 0.5 0 0 |
// | 0 0 0 0 |
// | 0.5 0.5 1 1 |
SMatrix4x4 matTexScale;
matTexScale.identify();
matTexScale._11 = 0.5f;
matTexScale._22 = -0.5f;
matTexScale._33 = 0.0f;
matTexScale.getOrigin().set( 0.5f, 0.5f, 1.0f );
SMatrix4x4 matTmp = camera.getProjectionMatrix() * matTexScale;
matTmp = projectorMatrix * matTmp;
dest = camera.getViewMatrix() * matTmp;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -