#!/usr/bin/env perl
use strict;
use warnings;
use blib;
use OpenGL::Simple ':all';
use OpenGL::Simple::GLUT ':all';
use OpenGL::Simple::Viewer;
use OpenGL::Simple::GLM ':all';

glutInit;

my $filename = shift @ARGV or die("Need .obj filename");
my $model = glmReadOBJ($filename);
glmUnitize($model);

my $v = new OpenGL::Simple::Viewer(
    draw_geometry => sub {
        glmDraw($model,GLM_SMOOTH|GLM_COLOR);
    },
);

glutMainLoop;

exit;

