本文整理汇总了C++中Matrix4x4::FromEulerAngleZ方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix4x4::FromEulerAngleZ方法的具体用法?C++ Matrix4x4::FromEulerAngleZ怎么用?C++ Matrix4x4::FromEulerAngleZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix4x4
的用法示例。
在下文中一共展示了Matrix4x4::FromEulerAngleZ方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaint
//.........这里部分代码省略.........
}
// Draw
cRenderer.DrawPrimitives(Primitive::TriangleStrip, 0, 4);
}
{ // Draw quadrangle 2: Color render target 1
// Set object space to clip space matrix uniform
ProgramUniform *pProgramUniform = m_pProgram->GetUniform("ObjectSpaceToClipSpaceMatrix");
if (pProgramUniform) {
mWorld.FromEulerAngleY(static_cast<float>(m_fRotation*Math::DegToRad));
mWorld.SetTranslation(-2.0f, 1.0f, 0.0f);
pProgramUniform->Set(mViewProjection*mWorld);
}
{ // Set the texture buffer we rendered our teapot in as the current texture buffer
const int nTextureUnit = m_pProgram->Set("DiffuseMap", m_pColorTarget1 ? static_cast<TextureBuffer*>(m_pColorTarget1) : m_pRenderTarget->GetTextureBuffer());
if (nTextureUnit >= 0) {
// Disable mip mapping - this is required because we created/filled no mipmaps for your texture buffer
cRenderer.SetSamplerState(nTextureUnit, Sampler::MagFilter, TextureFiltering::Linear);
cRenderer.SetSamplerState(nTextureUnit, Sampler::MinFilter, TextureFiltering::Linear);
cRenderer.SetSamplerState(nTextureUnit, Sampler::MipFilter, TextureFiltering::None);
}
}
// Draw
cRenderer.DrawPrimitives(Primitive::TriangleStrip, 0, 4);
}
{ // Draw quadrangle 3: Color render target 2
// Set object space to clip space matrix uniform
ProgramUniform *pProgramUniform = m_pProgram->GetUniform("ObjectSpaceToClipSpaceMatrix");
if (pProgramUniform) {
mWorld.FromEulerAngleZ(static_cast<float>(m_fRotation*Math::DegToRad));
mWorld.SetTranslation(0.0f, 1.0f, 0.0f);
pProgramUniform->Set(mViewProjection*mWorld);
}
{ // Set the texture buffer we rendered our teapot in as the current texture buffer
const int nTextureUnit = m_pProgram->Set("DiffuseMap", m_pColorTarget2 ? static_cast<TextureBuffer*>(m_pColorTarget2) : m_pRenderTarget->GetTextureBuffer());
if (nTextureUnit >= 0) {
// Disable mip mapping - this is required because we created/filled no mipmaps for your texture buffer
cRenderer.SetSamplerState(nTextureUnit, Sampler::MagFilter, TextureFiltering::Linear);
cRenderer.SetSamplerState(nTextureUnit, Sampler::MinFilter, TextureFiltering::Linear);
cRenderer.SetSamplerState(nTextureUnit, Sampler::MipFilter, TextureFiltering::None);
}
}
// Draw
cRenderer.DrawPrimitives(Primitive::TriangleStrip, 0, 4);
}
{ // Draw quadrangle 4: Color render target 3
// Set object space to clip space matrix uniform
ProgramUniform *pProgramUniform = m_pProgram->GetUniform("ObjectSpaceToClipSpaceMatrix");
if (pProgramUniform) {
mWorld.FromEulerAngleZ(static_cast<float>(-m_fRotation*Math::DegToRad));
mWorld.SetTranslation(-2.0f, -1.0f, 0.0f);
pProgramUniform->Set(mViewProjection*mWorld);
}
{ // Set the texture buffer we rendered our teapot in as the current texture buffer
const int nTextureUnit = m_pProgram->Set("DiffuseMap", m_pColorTarget3 ? static_cast<TextureBuffer*>(m_pColorTarget3) : m_pRenderTarget->GetTextureBuffer());
if (nTextureUnit >= 0) {
// Disable mip mapping - this is required because we created/filled no mipmaps for your texture buffer
cRenderer.SetSamplerState(nTextureUnit, Sampler::MagFilter, TextureFiltering::Linear);