⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 projector.cpp

📁 java实现的简单的分形树。简单易学!是学习分形知识的很好的例子。其java语法简单
💻 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 + -