本文整理汇总了C++中Renderable::get_model方法的典型用法代码示例。如果您正苦于以下问题:C++ Renderable::get_model方法的具体用法?C++ Renderable::get_model怎么用?C++ Renderable::get_model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderable
的用法示例。
在下文中一共展示了Renderable::get_model方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_draw
//.........这里部分代码省略.........
parabolicPointer = make_parabolic_pointer(worldSurface, params);
if (ImGui::SliderFloat("Point Count", ¶ms.pointCount, 16, 64))
parabolicPointer = make_parabolic_pointer(worldSurface, params);
ImGui::EndGroup();
const auto proj = camera.get_projection_matrix((float) width / (float) height);
const float4x4 view = camera.get_view_matrix();
const float4x4 viewProj = mul(proj, view);
glViewport(0, 0, width, height);
skydome.render(viewProj, camera.get_eye_point(), camera.farClip);
grid.render(proj, view);
{
simpleShader->bind();
simpleShader->uniform("u_eye", camera.get_eye_point());
simpleShader->uniform("u_viewProj", viewProj);
simpleShader->uniform("u_emissive", float3(0, 0, 0));
simpleShader->uniform("u_diffuse", float3(0.0f, 1.0f, 0.0f));
for (int i = 0; i < 2; i++)
{
simpleShader->uniform("u_lights[" + std::to_string(i) + "].position", lights[i].position);
simpleShader->uniform("u_lights[" + std::to_string(i) + "].color", lights[i].color);
}
for (const auto & model : shadedModels)
{
simpleShader->uniform("u_modelMatrix", model.get_model());
simpleShader->uniform("u_modelMatrixIT", inv(transpose(model.get_model())));
model.draw();
}
{
simpleShader->uniform("u_modelMatrix", turret.source.get_model());
simpleShader->uniform("u_modelMatrixIT", inv(transpose(turret.source.get_model())));
turret.source.draw();
simpleShader->uniform("u_modelMatrix", turret.target.get_model());
simpleShader->uniform("u_modelMatrixIT", inv(transpose(turret.target.get_model())));
turret.target.draw();
auto projectileMat = turret.projectile.p.matrix();
simpleShader->uniform("u_modelMatrix", projectileMat);
simpleShader->uniform("u_modelMatrixIT", inv(transpose(projectileMat)));
turret.bullet.draw();
}
simpleShader->unbind();
}
{
normalDebugShader->bind();
normalDebugShader->uniform("u_viewProj", viewProj);
// Some debug models
for (const auto & model : debugModels)
{
normalDebugShader->uniform("u_modelMatrix", model.get_model());
normalDebugShader->uniform("u_modelMatrixIT", inv(transpose(model.get_model())));
model.draw();