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");
|
|
|
|
|
2018-02-13 16:19:44 +01:00
|
|
|
Ball ball(Point(0, 5, 0), 0.75, -.5, -1, 1, 1);
|
2018-02-12 21:53:35 +01:00
|
|
|
|
|
|
|
Cuboid bbox = ball.get_surface()->max_bounding_box();
|
|
|
|
printf("%.2lf %.2lf %.2lf | %.2lf %.2lf %.2lf\n",
|
|
|
|
bbox.low(0), bbox.low(1), bbox.low(2),
|
|
|
|
bbox.high(0), bbox.high(1), bbox.high(2));
|
2018-02-13 16:19:44 +01:00
|
|
|
render.add_surface(ball.get_surface(), bbox);
|
2018-02-12 18:40:05 +01:00
|
|
|
|
|
|
|
render.set_idle_func(periodic_update);
|
|
|
|
init_periodic_static(&ball);
|
|
|
|
render.run();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|