本文整理汇总了C++中Mat4f::Row方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat4f::Row方法的具体用法?C++ Mat4f::Row怎么用?C++ Mat4f::Row使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat4f
的用法示例。
在下文中一共展示了Mat4f::Row方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
void Render(double time)
{
//
// the camera matrix
Mat4f camera = CamMatrixf::Orbiting(
Vec3f(),
6.5 + SineWave(time / 16.0) * 1.5,
FullCircles(time / 12.0),
Degrees(SineWave(time / 30.0) * 90)
);
//
// the model matrix
Mat4f model = ModelMatrixf::RotationA(
Vec3f(1.0f, 1.0f, 1.0f),
FullCircles(time / 10.0)
);
// the light position
Vec3f lightPos(0.0f, SineWave(time / 7.0) * 0.5, 0.0f);
//
SetProgramUniform(shape_prog, "LightPos", lightPos);
SetProgramUniform(depth_prog, "LightPos", lightPos);
SetProgramUniform(light_prog, "LightPos", lightPos);
//
SetProgramUniform(shape_prog, "CameraMatrix", camera);
SetProgramUniform(light_prog, "CameraMatrix", camera);
SetProgramUniform(shape_prog, "ModelMatrix", model);
SetProgramUniform(depth_prog, "ModelMatrix", model);
// render the shadow map
depth_fbo.Bind(Framebuffer::Target::Draw);
gl.DrawBuffer(ColorBuffer::None);
gl.Viewport(tex_side, tex_side);
gl.Clear().DepthBuffer();
depth_prog.Use();
shape.Bind();
shape_instr.Draw(shape_indices);
// render the output frame
Framebuffer::BindDefault(Framebuffer::Target::Draw);
gl.DrawBuffer(ColorBuffer::Back);
gl.Viewport(width, height);
gl.Clear().ColorBuffer().DepthBuffer();
shape_prog.Use();
shape.Bind();
shape_instr.Draw(shape_indices);
gl.Enable(Capability::Blend);
light_prog.Use();
SetUniform(light_prog, "ViewX", camera.Row(0).xyz());
SetUniform(light_prog, "ViewY", camera.Row(1).xyz());
SetUniform(light_prog, "ViewZ", camera.Row(2).xyz());
light.Bind();
gl.DrawArraysInstanced(
PrimitiveType::Points,
0, 1,
sample_count
);
gl.Disable(Capability::Blend);
}