X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=tools%2Fropesim%2Fsrc%2Fmain.c;h=bfd6424cfc6b6ca99a1e0708e50a2a6c10ce01fd;hp=dcabef5a2e5b8f69b861e4490b1aa238eb8cf796;hb=80ffa1d4b9436c6cd0a71089434f8c2acf738b16;hpb=be72aee3c4a0a5516bdccf06c5419efe3e026ee4 diff --git a/tools/ropesim/src/main.c b/tools/ropesim/src/main.c index dcabef5..bfd6424 100644 --- a/tools/ropesim/src/main.c +++ b/tools/ropesim/src/main.c @@ -2,6 +2,7 @@ #include #include #include "cmesh.h" +#include "cgmath/cgmath.h" int init(void); void cleanup(void); @@ -20,11 +21,13 @@ int prev_mx, prev_my; int bnstate[8]; struct cmesh *scn; +struct cmesh *mesh_gout, *mesh_gin, *mesh_suz; +cgm_vec3 ganchor[4]; int main(int argc, char **argv) { glutInit(&argc, argv); - glutInitWindowSize(800, 600); + glutInitWindowSize(1280, 800); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); glutCreateWindow("ropesim"); @@ -50,7 +53,10 @@ int main(int argc, char **argv) int init(void) { - float amb[] = {0.05, 0.05, 0.08, 1}; + static const char *meshnames[] = {"suzanne", "gimbal_outer", "gimbal_inner"}; + static struct cmesh **meshes[] = {&mesh_suz, &mesh_gout, &mesh_gin}; + static const float amb[] = {0.05, 0.05, 0.08, 1}; + int i; glEnable(GL_CULL_FACE); glEnable(GL_DEPTH_TEST); @@ -65,11 +71,28 @@ int init(void) fprintf(stderr, "failed to load scene file\n"); return -1; } + + for(i=0; i