Browse Source

Small change to trackball example

Former-commit-id: 292770f7fdce908f861737f569f06021f515e794
jalec 13 years ago
parent
commit
c12e0692fe
2 changed files with 3 additions and 31 deletions
  1. 1 1
      examples/trackball/Makefile
  2. 2 30
      examples/trackball/example.cpp

+ 1 - 1
examples/trackball/Makefile

@@ -7,7 +7,7 @@ all: example
 
 
 igl_lib=../../
 igl_lib=../../
 
 
-CFLAGS=-g
+CFLAGS=-g -Wall
 inc=-I$(igl_lib)
 inc=-I$(igl_lib)
 
 
 example: example.o
 example: example.o

+ 2 - 30
examples/trackball/example.cpp

@@ -1,37 +1,11 @@
 /*
 /*
   This is an example program that came with AntTweakBar modified to not use
   This is an example program that came with AntTweakBar modified to not use
   AntTweakBar and just show how a trackball works
   AntTweakBar and just show how a trackball works
-
-  On mac os x compile with:
-
   g++ -c example.cpp -o example.o 
   g++ -c example.cpp -o example.o 
   g++ -o example example.o -framework OpenGL -framework GLUT
   g++ -o example example.o -framework OpenGL -framework GLUT
   rm *.o
   rm *.o
-
 */
 */
 
 
-#ifdef __APPLE__
-#define _MACOSX
-#endif
-// ORIGINAL COPYRIGHT INFO
-//  ---------------------------------------------------------------------------
-//
-//  @file       TwSimpleGLUT.c
-//  @brief      A simple example that uses AntTweakBar with OpenGL and GLUT.
-//
-//              AntTweakBar: http://www.antisphere.com/Wiki/tools:anttweakbar
-//              OpenGL:      http://www.opengl.org
-//              GLUT:        http://opengl.org/resources/libraries/glut
-//  
-//  @author     Philippe Decaudin - http://www.antisphere.com
-//  @date       2006/05/20
-//
-//  Compilation:
-//  http://www.antisphere.com/Wiki/tools:anttweakbar:examples#twsimpleglut
-//
-//  ---------------------------------------------------------------------------
-
-
 // IGL library
 // IGL library
 #include "quat_to_mat.h"
 #include "quat_to_mat.h"
 #include "quat_mult.h"
 #include "quat_mult.h"
@@ -53,7 +27,7 @@ using namespace std;
 
 
 #if defined(USE_MINI_GLUT)
 #if defined(USE_MINI_GLUT)
 #   include "../src/MiniGLUT.h"
 #   include "../src/MiniGLUT.h"
-#elif defined(_MACOSX)
+#elif defined(__APPLE__)
 #   include <GLUT/glut.h>
 #   include <GLUT/glut.h>
 #else
 #else
 #   include <GL/glut.h>
 #   include <GL/glut.h>
@@ -138,7 +112,6 @@ void Display(void)
   
   
   // Rotate and draw shape
   // Rotate and draw shape
   glPushMatrix();
   glPushMatrix();
-  glTranslatef(0.5f, -0.3f, 0.0f);
   float mat[4*4]; // rotation matrix
   float mat[4*4]; // rotation matrix
   quat_to_mat(rotation,mat);
   quat_to_mat(rotation,mat);
   glMultMatrixf(mat);
   glMultMatrixf(mat);
@@ -167,7 +140,6 @@ void Reshape(int width, int height)
   glMatrixMode(GL_MODELVIEW);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   glLoadIdentity();
   gluLookAt(0,0,5, 0,0,0, 0,1,0);
   gluLookAt(0,0,5, 0,0,0, 0,1,0);
-  glTranslatef(0, 0.6f, -1);
 }
 }
 
 
 
 
@@ -212,7 +184,7 @@ int main(int argc, char *argv[])
   glutInit(&argc, argv);
   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
   glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
   glutInitWindowSize(640, 480);
   glutInitWindowSize(640, 480);
-  glutCreateWindow("AntTweakBar simple example using GLUT");
+  glutCreateWindow("Simple GLUT example with trackball");
   glutCreateMenu(NULL);
   glutCreateMenu(NULL);
   
   
   // Set GLUT callbacks
   // Set GLUT callbacks