本文整理汇总了C++中MeshRenderer::SetLightType方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshRenderer::SetLightType方法的具体用法?C++ MeshRenderer::SetLightType怎么用?C++ MeshRenderer::SetLightType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshRenderer
的用法示例。
在下文中一共展示了MeshRenderer::SetLightType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
// Create freeglut window
GlutWindowManager* windowMgr = GlutWindowManager::GetInstance();
//StaticData::SetWindowManager(windowManager);
windowMgr->Init(argc, argv);
Window* window = windowMgr->NewWindow(1, 500, 500, 200, 200, "Window 1");
// Create mesh renderer (init openGL)
MeshRenderer* meshRenderer = new MeshRenderer(WINDOW_WIDTH, WINDOW_HEIGHT);
//StaticData::SetMeshRenderer(meshRenderer);
meshRenderer->Init();
// Load mesh
Mesh* mesh = NULL;
Rendering::Operators::ObjReader::LoadMesh("Models\\cube.obj", mesh, true);
Rendering::Operators::MeshTransformation::Triangulate(mesh);
mesh->ComputeNormals();
mesh->color = glm::vec4(0.0f, 1.0f, 0.0f, 1.0f);
meshRenderer->SetMesh(mesh);
meshRenderer->SetRenderMode((RenderMode)(RenderMode::VERTICES | RenderMode::WIREFRAME));
meshRenderer->SetLightType(LightType::POINT_LIGHT);
meshRenderer->SetLightColor(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f));
//Operators::MeshTransformation::Inflate(mesh, 0.1f);
//meshRenderer->UpdateMeshConnectivity();
// Create a WindowRenderer and link it to the window
WindowRenderer winRenderer(meshRenderer);
window->Attach(&winRenderer);
// Create manipulators
MouseManipulator mouseManip(meshRenderer);
Mouse* mouse = windowMgr->GetMouse();
mouse->Attach(&mouseManip);
// Start main loop
windowMgr->Display();
//delete windowManager;
delete meshRenderer;
return 0;
}