mpri-graphics-project/main_bounce.cpp

25 lines
648 B
C++
Raw Normal View History

2018-02-12 18:40:05 +01:00
/** An entry-point file using render/GlutRender as a renderer, displaying the
* bouncing implicit-surface defined sphere.
**/
#include "render/GlutRender.hpp"
#include "Ball.hpp"
#include "MarchingCubes.hpp"
#include "periodic_updates.hpp"
int main(int argc, char** argv) {
GlutRender& render = GlutRender::get_instance();
render.init(&argc, argv, 640, 480, "Bouncing stuff");
Ball ball(Point(0, 0, 10), 0, .25, 1, 1);
render.add_surface(ball.get_surface(),
Cuboid(Point(-2, -2, -2), Point(2, 2, 2)));
render.set_idle_func(periodic_update);
init_periodic_static(&ball);
render.run();
return 0;
}