本文整理汇总了C++中Pipeline::SetFrustumProj方法的典型用法代码示例。如果您正苦于以下问题:C++ Pipeline::SetFrustumProj方法的具体用法?C++ Pipeline::SetFrustumProj怎么用?C++ Pipeline::SetFrustumProj使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pipeline
的用法示例。
在下文中一共展示了Pipeline::SetFrustumProj方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderSceneCB
virtual void RenderSceneCB()
{
// auto close
framesPassed++;
if (receivedPacket) {
if (framesPassed > 180) exit(0);
} else {
if (framesPassed > 900) exit(0);
}
m_pGameCamera->OnRender();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
PointLight pl[2];
pl[0].DiffuseIntensity = 0.1f;
pl[0].Color = Vector3f(1.0f, 0.5f, 0.0f);
pl[0].Position = Vector3f(3.0f, 1.0f, FieldDepth * (cosf(rotation) + 1.0f) / 2.0f);
pl[0].Attenuation.Linear = 0.1f;
pl[1].DiffuseIntensity = 0.25f;
pl[1].Color = Vector3f(0.0f, 0.5f, 1.0f);
pl[1].Position = Vector3f(7.0f, 1.0f, FieldDepth * (sinf(rotation) + 1.0f) / 2.0f);
pl[1].Attenuation.Linear = 0.1f;
m_pEffect->SetPointLights(2, pl);
SpotLight sl[2];
sl[0].DiffuseIntensity = 0.1f;
sl[0].Color = Vector3f(0.0f, 1.0f, 1.0f);
sl[0].Position = m_pGameCamera->GetPos();
sl[0].Direction = m_pGameCamera->GetTarget();
sl[0].Attenuation.Linear = 0.1f;
sl[0].Cutoff = 10.0f;
sl[1].DiffuseIntensity = 0.1f;
sl[1].Color = Vector3f(0.0f, 0.5f, 1.0f);
sl[1].Position = Vector3f(7.0f, 1.0f, FieldDepth * (sinf(rotation) + 1.0f) / 2.0f);
sl[1].Attenuation.Linear = 0.1f;
m_pEffect->SetSpotLights(1, sl);
Pipeline p;
p.Scale(1.f, 1.f, 1.f);
p.Rotate(-90.0f, -90.0f, 0.0f);
p.WorldPos(2.0f, 0.0f,8.0f);
//p.WorldPos(-110.f, -69.0f, -120.f);
p.SetCamera(m_pGameCamera->GetPos(), m_pGameCamera->GetTarget(), m_pGameCamera->GetUp());
// p.SetPerspectiveProj(60.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 1.0f, 100.0f);
GLdouble fW, fH;
fH = tan(60.0f / 360.0 * M_PI) * 1.0;
fW = fH * (SCREEN_WIDTH/(float)SCREEN_HEIGHT);
//p.SetFrustumProj(-fW, fW, -fH, fH, 1.0, 100);
float height = 0+1.44;
p.SetFrustumProj(ortho_left, ortho_right, ortho_bottom-height, ortho_top-height, 1.0f, 400.f);
// p.SetFrustumProj(-.1, .1, -.1, .1, 0.1f, 500.0f);
m_pEffect->SetWVP(p.GetWVPTrans());
m_pEffect->SetWorldMatrix(p.GetWorldTrans());
m_pEffect->SetDirectionalLight(m_directionalLight);
m_pEffect->SetEyeWorldPos(m_pGameCamera->GetPos()); /* */
m_pEffect->SetMatSpecularIntensity(0.0f);
m_pEffect->SetMatSpecularPower(0); /* */
m_pMesh->Render();
glutSwapBuffers();
glutPostRedisplay(); // request redisplay
}