void Render() { using namespace oglplus; gl.Clear().ColorBuffer().DoIt(); GLfloat t = GLfloat(FrameTime()); rndr.Use(); text_stream.str(std::string()); text_stream << "Time: " << std::fixed << std::setw(5) << std::setprecision(3) << t << " [s]"; if(time_str != text_stream.str()) { time_str = text_stream.str(); time_layout.Set(time_str); } rndr.SetCamera(CamMatrixf::Orbiting( Vec3f(), GLfloat(9.0 + SineWave(t / 7.0) * 3.0), -FullCircles(t / 17.0), Degrees(SineWave(t / 21.0) * 35))); rndr.SetLayoutTransform(ModelMatrixf::Translation(-3.0f, 0.7f, 1.1f)); rndr.Render(oglp_layout); rndr.SetLayoutTransform(ModelMatrixf::Translation(-6.0f, -0.7f, 0.0f)); rndr.Render(desc_layout); rndr.SetLayoutTransform( ModelMatrixf::Translation(-4.0f, -2.0f, -0.5f) * ModelMatrixf::Scale(0.7f, 0.7f, 0.5f)); rndr.Render(time_layout); }
void Render(void) { using namespace oglplus; GLfloat t = GLfloat(FrameTime()); GLfloat i = t*0.3f; int interval = int(i); GLfloat f = i - GLfloat(interval); if(prev_interval < interval) { LoadNext(); prev_interval = interval; } gl.Clear().ColorBuffer().DoIt(); rndr_opacity.Set(SineWave(f*0.5f)); rndr.SetLayoutTransform(ModelMatrixf::TranslationZ(-20.0f+16.0f*f)); rndr.Render(layout); }