Index: /orxonox/branches/osX/configure
===================================================================
--- /orxonox/branches/osX/configure	(revision 2976)
+++ /orxonox/branches/osX/configure	(revision 2977)
@@ -3741,5 +3741,23 @@
 fi
 
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+### CHECKING FOR SYSTEM ###
+
+echo "$as_me:$LINENO: checking for System" >&5
+echo $ECHO_N "checking for System... $ECHO_C" >&6
+case `uname` in
+### WINDOWS ###
+  *MINGW*)
+echo "mingw-WINDOWS detected"
+
+    mingw="yes"
+    MSBITFIELDS="-mms-bitfields"
+    MWINDOWS="-mwindows"
+
+# checking gl header
+	#done before loop
+
+# checking gl header
+   # On IRIX 5.3, sys/types and inttypes.h are conflicting.
 
 
@@ -3813,5 +3831,6 @@
 
 
-for ac_header in
+
+for ac_header in GL/gl.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -3958,30 +3977,90 @@
 _ACEOF
 
+else
+  { { echo "$as_me:$LINENO: error: cannot find opengl headers" >&5
+echo "$as_me: error: cannot find opengl headers" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 done
 
-
-
-
-### CHECKING FOR SYSTEM ###
-
-echo "$as_me:$LINENO: checking for System" >&5
-echo $ECHO_N "checking for System... $ECHO_C" >&6
-case `uname` in
-### WINDOWS ###
-  *MINGW*)
-echo "mingw-WINDOWS detected"
-
-    mingw="yes"
-    MSBITFIELDS="-mms-bitfields"
-    MWINDOWS="-mwindows"
-
-# checking gl header
-	#done before loop
-
-# checking gl header (has to be here because of a Linux error)
-
-for ac_header in GL/gl.h
+#   checking for Windows openGl library
+    echo "$as_me:$LINENO: checking for main in -lopengl32" >&5
+echo $ECHO_N "checking for main in -lopengl32... $ECHO_C" >&6
+if test "${ac_cv_lib_opengl32_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lopengl32  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_opengl32_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_opengl32_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_opengl32_main" >&5
+echo "${ECHO_T}$ac_cv_lib_opengl32_main" >&6
+if test $ac_cv_lib_opengl32_main = yes; then
+  FOUND_opengl32=yes
+else
+  "gl/gl.h"
+fi
+
+    if test "$FOUND_opengl32" = "yes" ; then
+	LIBS="$LIBS -lopengl32"
+    else
+	 echo "------------------"
+	 echo "opengl not found."
+	 echo "please install the opengl package which can be found at http://www.opengl.org"
+	 echo "------------------"
+	 exit -1
+    fi
+
+# cheking for GLU-header
+
+for ac_header in GL/glu.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -4136,12 +4215,13 @@
 done
 
-#   checking for Windows openGl library
-    echo "$as_me:$LINENO: checking for main in -lopengl32" >&5
-echo $ECHO_N "checking for main in -lopengl32... $ECHO_C" >&6
-if test "${ac_cv_lib_opengl32_main+set}" = set; then
+
+# checking for libGLU
+    echo "$as_me:$LINENO: checking for main in -lglu32" >&5
+echo $ECHO_N "checking for main in -lglu32... $ECHO_C" >&6
+if test "${ac_cv_lib_glu32_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lopengl32  $LIBS"
+LIBS="-lglu32  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -4182,10 +4262,10 @@
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_opengl32_main=yes
+  ac_cv_lib_glu32_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_opengl32_main=no
+ac_cv_lib_glu32_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
@@ -4193,25 +4273,90 @@
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_opengl32_main" >&5
-echo "${ECHO_T}$ac_cv_lib_opengl32_main" >&6
-if test $ac_cv_lib_opengl32_main = yes; then
-  FOUND_opengl32=yes
-else
-  "gl/gl.h"
-fi
-
-    if test "$FOUND_opengl32" = "yes" ; then
-	LIBS="$LIBS -lopengl32"
+echo "$as_me:$LINENO: result: $ac_cv_lib_glu32_main" >&5
+echo "${ECHO_T}$ac_cv_lib_glu32_main" >&6
+if test $ac_cv_lib_glu32_main = yes; then
+  FOUND_glu32=yes
+fi
+
+    if test "$FOUND_glu32" = "yes" ; then
+	LIBS="$LIBS -lGLU32"
     else
 	 echo "------------------"
-	 echo "opengl not found."
-	 echo "please install the opengl package which can be found at http://www.opengl.org"
+	 echo "GLU library not found."
+	 echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
 	 echo "------------------"
 	 exit -1
     fi
 
-# cheking for GLU-header
-
-for ac_header in GL/glu.h
+
+# checking for mingw32
+    echo "$as_me:$LINENO: checking for main in -lmingw32" >&5
+echo $ECHO_N "checking for main in -lmingw32... $ECHO_C" >&6
+if test "${ac_cv_lib_mingw32_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmingw32  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_mingw32_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_mingw32_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_mingw32_main" >&5
+echo "${ECHO_T}$ac_cv_lib_mingw32_main" >&6
+if test $ac_cv_lib_mingw32_main = yes; then
+  FOUND_mingw32=yes
+fi
+
+    if test $FOUND_mingw32 = "yes"; then
+	LIBS="$LIBS -lmingw32"
+    fi
+# checking for SDL-headers
+
+for ac_header in SDL/SDL.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -4359,6 +4504,6 @@
 
 else
-  { { echo "$as_me:$LINENO: error: cannot find opengl headers" >&5
-echo "$as_me: error: cannot find opengl headers" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find SDL headers" >&5
+echo "$as_me: error: cannot find SDL headers" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -4367,12 +4512,12 @@
 
 
-# checking for libGLU
-    echo "$as_me:$LINENO: checking for main in -lglu32" >&5
-echo $ECHO_N "checking for main in -lglu32... $ECHO_C" >&6
-if test "${ac_cv_lib_glu32_main+set}" = set; then
+#checking for libSDL
+    echo "$as_me:$LINENO: checking for main in -lsdlmain" >&5
+echo $ECHO_N "checking for main in -lsdlmain... $ECHO_C" >&6
+if test "${ac_cv_lib_sdlmain_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lglu32  $LIBS"
+LIBS="-lsdlmain  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -4413,10 +4558,10 @@
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_glu32_main=yes
+  ac_cv_lib_sdlmain_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_glu32_main=no
+ac_cv_lib_sdlmain_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
@@ -4424,29 +4569,26 @@
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_glu32_main" >&5
-echo "${ECHO_T}$ac_cv_lib_glu32_main" >&6
-if test $ac_cv_lib_glu32_main = yes; then
-  FOUND_glu32=yes
-fi
-
-    if test "$FOUND_glu32" = "yes" ; then
-	LIBS="$LIBS -lGLU32"
+echo "$as_me:$LINENO: result: $ac_cv_lib_sdlmain_main" >&5
+echo "${ECHO_T}$ac_cv_lib_sdlmain_main" >&6
+if test $ac_cv_lib_sdlmain_main = yes; then
+  FOUND_sdlmain=yes
+fi
+
+    if test "$FOUND_sdlmain" = "yes" ; then
+	LIBS="$LIBS -lsdlmain"
     else
 	 echo "------------------"
-	 echo "GLU library not found."
-	 echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
+	 echo "SDL library not found."
+	 echo "please install the SDL library, which can be found at http://www.libsdl.org"
 	 echo "------------------"
-	 exit -1
+	 exit 1
     fi
-
-
-# checking for mingw32
-    echo "$as_me:$LINENO: checking for main in -lmingw32" >&5
-echo $ECHO_N "checking for main in -lmingw32... $ECHO_C" >&6
-if test "${ac_cv_lib_mingw32_main+set}" = set; then
+    echo "$as_me:$LINENO: checking for main in -lsdl" >&5
+echo $ECHO_N "checking for main in -lsdl... $ECHO_C" >&6
+if test "${ac_cv_lib_sdl_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmingw32  $LIBS"
+LIBS="-lsdl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -4487,10 +4629,10 @@
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_mingw32_main=yes
+  ac_cv_lib_sdl_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_mingw32_main=no
+ac_cv_lib_sdl_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
@@ -4498,16 +4640,31 @@
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_mingw32_main" >&5
-echo "${ECHO_T}$ac_cv_lib_mingw32_main" >&6
-if test $ac_cv_lib_mingw32_main = yes; then
-  FOUND_mingw32=yes
-fi
-
-    if test $FOUND_mingw32 = "yes"; then
-	LIBS="$LIBS -lmingw32"
+echo "$as_me:$LINENO: result: $ac_cv_lib_sdl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_sdl_main" >&6
+if test $ac_cv_lib_sdl_main = yes; then
+  FOUND_sdl=yes
+fi
+
+    if test "$FOUND_sdl" = "yes" ; then
+    	LIBS="$LIBS -lsdl"
+    else
+	 echo "------------------"
+	 echo "SDL library not found."
+	 echo "please install the SDL library, which can be found at http://www.libsdl.org"
+	 echo "------------------"
+	 exit -1
     fi
-# checking for SDL-headers
-
-for ac_header in SDL/SDL.h
+
+    ;;
+
+### LINUX ###
+ *Linux*)
+echo "Linux detected"
+
+ Linux="yes"
+
+# checking gl header
+
+for ac_header in GL/gl.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -4655,6 +4812,6 @@
 
 else
-  { { echo "$as_me:$LINENO: error: cannot find SDL headers" >&5
-echo "$as_me: error: cannot find SDL headers" >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find opengl headers" >&5
+echo "$as_me: error: cannot find opengl headers" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -4663,12 +4820,12 @@
 
 
-#checking for libSDL
-    echo "$as_me:$LINENO: checking for main in -lsdlmain" >&5
-echo $ECHO_N "checking for main in -lsdlmain... $ECHO_C" >&6
-if test "${ac_cv_lib_sdlmain_main+set}" = set; then
+#  checking for Unix GL
+   echo "$as_me:$LINENO: checking for main in -lGL" >&5
+echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6
+if test "${ac_cv_lib_GL_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsdlmain  $LIBS"
+LIBS="-lGL  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -4709,10 +4866,10 @@
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_sdlmain_main=yes
+  ac_cv_lib_GL_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_sdlmain_main=no
+ac_cv_lib_GL_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
@@ -4720,102 +4877,23 @@
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_sdlmain_main" >&5
-echo "${ECHO_T}$ac_cv_lib_sdlmain_main" >&6
-if test $ac_cv_lib_sdlmain_main = yes; then
-  FOUND_sdlmain=yes
-fi
-
-    if test "$FOUND_sdlmain" = "yes" ; then
-	LIBS="$LIBS -lsdlmain"
-    else
+echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5
+echo "${ECHO_T}$ac_cv_lib_GL_main" >&6
+if test $ac_cv_lib_GL_main = yes; then
+  FOUND_GL=yes
+fi
+
+   if test "$FOUND_GL" = "yes" ; then
+     LIBS="$LIBS -lGL"
+   else
 	 echo "------------------"
-	 echo "SDL library not found."
-	 echo "please install the SDL library, which can be found at http://www.libsdl.org"
-	 echo "------------------"
-	 exit 1
-    fi
-    echo "$as_me:$LINENO: checking for main in -lsdl" >&5
-echo $ECHO_N "checking for main in -lsdl... $ECHO_C" >&6
-if test "${ac_cv_lib_sdl_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsdl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-
-int
-main ()
-{
-main ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_sdl_main=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_sdl_main=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_sdl_main" >&5
-echo "${ECHO_T}$ac_cv_lib_sdl_main" >&6
-if test $ac_cv_lib_sdl_main = yes; then
-  FOUND_sdl=yes
-fi
-
-    if test "$FOUND_sdl" = "yes" ; then
-    	LIBS="$LIBS -lsdl"
-    else
-	 echo "------------------"
-	 echo "SDL library not found."
-	 echo "please install the SDL library, which can be found at http://www.libsdl.org"
+	 echo "opengl not found."
+	 echo "please install the opengl package which can be found at http://www.opengl.org"
 	 echo "------------------"
 	 exit -1
-    fi
-
-    ;;
-
-### LINUX ###
- *Linux*)
-echo "Linux detected"
-
- Linux="yes"
-
-# checking gl header (has to be here because of a Linux error)
-
-for ac_header in GL/gl.h
+   fi
+
+# cheking for GLU-header
+
+for ac_header in GL/glu.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -4971,12 +5049,11 @@
 
 
-#  checking for Unix GL
-   echo "$as_me:$LINENO: checking for main in -lGL" >&5
-echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6
-if test "${ac_cv_lib_GL_main+set}" = set; then
+    echo "$as_me:$LINENO: checking for gluProject in -lGLU" >&5
+echo $ECHO_N "checking for gluProject in -lGLU... $ECHO_C" >&6
+if test "${ac_cv_lib_GLU_gluProject+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGL  $LIBS"
+LIBS="-lGLU  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -4986,9 +5063,15 @@
 /* end confdefs.h.  */
 
-
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gluProject ();
 int
 main ()
 {
-main ();
+gluProject ();
   ;
   return 0;
@@ -5017,10 +5100,10 @@
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_GL_main=yes
+  ac_cv_lib_GLU_gluProject=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_GL_main=no
+ac_cv_lib_GLU_gluProject=no
 fi
 rm -f conftest.err conftest.$ac_objext \
@@ -5028,23 +5111,23 @@
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5
-echo "${ECHO_T}$ac_cv_lib_GL_main" >&6
-if test $ac_cv_lib_GL_main = yes; then
-  FOUND_GL=yes
-fi
-
-   if test "$FOUND_GL" = "yes" ; then
-     LIBS="$LIBS -lGL"
-   else
+echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_gluProject" >&5
+echo "${ECHO_T}$ac_cv_lib_GLU_gluProject" >&6
+if test $ac_cv_lib_GLU_gluProject = yes; then
+  FOUND_GLU=yes
+fi
+
+    if test "$FOUND_GLU" = "yes" ; then
+      LIBS="$LIBS -lGLU"
+    else
 	 echo "------------------"
-	 echo "opengl not found."
-	 echo "please install the opengl package which can be found at http://www.opengl.org"
+	 echo "GLU library not found."
+	 echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
 	 echo "------------------"
 	 exit -1
-   fi
-
-# cheking for GLU-header
-
-for ac_header in GL/glu.h
+    fi
+
+# checking for SDL-headers
+
+for ac_header in SDL/SDL.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -5192,238 +5275,4 @@
 
 else
-  { { echo "$as_me:$LINENO: error: cannot find opengl headers" >&5
-echo "$as_me: error: cannot find opengl headers" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-done
-
-
-    echo "$as_me:$LINENO: checking for gluProject in -lGLU" >&5
-echo $ECHO_N "checking for gluProject in -lGLU... $ECHO_C" >&6
-if test "${ac_cv_lib_GLU_gluProject+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGLU  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char gluProject ();
-int
-main ()
-{
-gluProject ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_GLU_gluProject=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_GLU_gluProject=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_gluProject" >&5
-echo "${ECHO_T}$ac_cv_lib_GLU_gluProject" >&6
-if test $ac_cv_lib_GLU_gluProject = yes; then
-  FOUND_GLU=yes
-fi
-
-    if test "$FOUND_GLU" = "yes" ; then
-      LIBS="$LIBS -lGLU"
-    else
-	 echo "------------------"
-	 echo "GLU library not found."
-	 echo "please install the GLU library, that should come with openGL, which can be found at http://www.opengl.org"
-	 echo "------------------"
-	 exit -1
-    fi
-
-# checking for SDL-headers
-
-for ac_header in SDL/SDL.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------- ##
-## Report this to orxonox-dev@mail.datacore.ch ##
-## ------------------------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-else
   { { echo "$as_me:$LINENO: error: cannot find SDL headers" >&5
 echo "$as_me: error: cannot find SDL headers" >&2;}
@@ -5506,16 +5355,5 @@
      fi
 
-    ;;
-  *)
-    mingw="no"
-    ;;
-esac
-echo "$as_me:$LINENO: result: $mingw" >&5
-echo "${ECHO_T}$mingw" >&6
-
-
-#### Checking for LIBraries.
-
-# FIXME: Replace `main' with a function in `-lOSMesa':
+     # FIXME: Replace `main' with a function in `-lOSMesa':
 
 echo "$as_me:$LINENO: checking for main in -lOSMesa" >&5
@@ -5586,5 +5424,5 @@
 fi
 
-# FIXME: Replace `main' with a function in `-lX11':
+     # FIXME: Replace `main' with a function in `-lX11':
 
 echo "$as_me:$LINENO: checking for main in -lX11" >&5
@@ -5655,5 +5493,5 @@
 fi
 
-# FIXME: Replace `main' with a function in `-lXt':
+     # FIXME: Replace `main' with a function in `-lXt':
 
 echo "$as_me:$LINENO: checking for main in -lXt" >&5
@@ -5724,8 +5562,16 @@
 fi
 
+    ;;
+  *)
+    mingw="no"
+    ;;
+esac
+
+
+
 
 
 #checking for pthread libs
-echo "$as_me:$LINENO: checking for main in -lpthread" >&5
+ echo "$as_me:$LINENO: checking for main in -lpthread" >&5
 echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
 if test "${ac_cv_lib_pthread_main+set}" = set; then
@@ -5789,7 +5635,7 @@
 fi
 
-if test "$FOUND_pthread" = "yes" ; then
+ if test "$FOUND_pthread" = "yes" ; then
     LIBS="$LIBS -lpthread"
-fi
+ fi
 
 
Index: /orxonox/branches/osX/configure.ac
===================================================================
--- /orxonox/branches/osX/configure.ac	(revision 2976)
+++ /orxonox/branches/osX/configure.ac	(revision 2977)
@@ -16,7 +16,5 @@
 
 
-AC_CHECK_HEADERS(,,,)
-
-
+AC_HEADER_STDC
 
 ### CHECKING FOR SYSTEM ###
@@ -35,5 +33,5 @@
 	#done before loop
 
-# checking gl header (has to be here because of a Linux error)
+# checking gl header
    AC_CHECK_HEADERS(GL/gl.h ,,
       [AC_MSG_ERROR([cannot find opengl headers]) ])
@@ -106,5 +104,5 @@
  Linux="yes"
 
-# checking gl header (has to be here because of a Linux error)
+# checking gl header
    AC_CHECK_HEADERS(GL/gl.h ,,
       [AC_MSG_ERROR([cannot find opengl headers]) ])
@@ -152,4 +150,10 @@
      fi   
 	
+     # FIXME: Replace `main' with a function in `-lOSMesa':
+      AC_CHECK_LIB([OSMesa], [main])
+     # FIXME: Replace `main' with a function in `-lX11':
+      AC_CHECK_LIB([X11], [main])
+     # FIXME: Replace `main' with a function in `-lXt':
+      AC_CHECK_LIB([Xt], [main])
     ;;
   *)
@@ -157,22 +161,14 @@
     ;;
 esac
-AC_MSG_RESULT([$mingw])
+
 AC_SUBST(MSBITFIELDS)
 
-#### Checking for LIBraries.
-
-# FIXME: Replace `main' with a function in `-lOSMesa':
-AC_CHECK_LIB([OSMesa], [main])
-# FIXME: Replace `main' with a function in `-lX11':
-AC_CHECK_LIB([X11], [main])
-# FIXME: Replace `main' with a function in `-lXt':
-AC_CHECK_LIB([Xt], [main])
 
 
 #checking for pthread libs
-AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
-if test "$FOUND_pthread" = "yes" ; then
+ AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
+ if test "$FOUND_pthread" = "yes" ; then
     LIBS="$LIBS -lpthread"
-fi
+ fi
 
 
@@ -180,5 +176,5 @@
 
 # FIXME: Replace `main' with a function in `-lm':
-AC_CHECK_LIB([m], [main])
+ AC_CHECK_LIB([m], [main])
 
 LIBS="$LIBS `pkg-config --libs  gtk+-2.0`"
Index: /orxonox/branches/osX/importer/Makefile.am
===================================================================
--- /orxonox/branches/osX/importer/Makefile.am	(revision 2976)
+++ /orxonox/branches/osX/importer/Makefile.am	(revision 2977)
@@ -6,7 +6,7 @@
 
 bin_PROGRAMS=importer
-importer_SOURCES=framework.cc windowHandler.cc object.cc array.cc material.cc
+importer_SOURCES=framework.cc windowHandler.cc vector.cc object.cc array.cc material.cc
 
-noinst_HEADERS=windowHandler.h object.h array.h material.h
+noinst_HEADERS=framework.h windowHandler.h  vector.h object.h array.h material.h
 
 
Index: /orxonox/branches/osX/importer/Makefile.in
===================================================================
--- /orxonox/branches/osX/importer/Makefile.in	(revision 2976)
+++ /orxonox/branches/osX/importer/Makefile.in	(revision 2977)
@@ -53,5 +53,6 @@
 PROGRAMS = $(bin_PROGRAMS)
 am_importer_OBJECTS = framework.$(OBJEXT) windowHandler.$(OBJEXT) \
-	object.$(OBJEXT) array.$(OBJEXT) material.$(OBJEXT)
+	vector.$(OBJEXT) object.$(OBJEXT) array.$(OBJEXT) \
+	material.$(OBJEXT)
 importer_OBJECTS = $(am_importer_OBJECTS)
 importer_LDADD = $(LDADD)
@@ -61,5 +62,5 @@
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po ./$(DEPDIR)/framework.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/material.Po ./$(DEPDIR)/object.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/windowHandler.Po
+@AMDEP_TRUE@	./$(DEPDIR)/vector.Po ./$(DEPDIR)/windowHandler.Po
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -151,6 +152,6 @@
 AM_CXXFLAGS = "-I/usr/X11R6/include"
 AM_LDFLAGS = "-L/usr/Mesa-6.0.1/lib  -L/usr/X11R6/lib -lXt -lX11" $(MWINDOWS)
-importer_SOURCES = framework.cc windowHandler.cc object.cc array.cc material.cc
-noinst_HEADERS = windowHandler.h object.h array.h material.h
+importer_SOURCES = framework.cc windowHandler.cc vector.cc object.cc array.cc material.cc
+noinst_HEADERS = framework.h windowHandler.h  vector.h object.h array.h material.h
 all: all-am
 
@@ -223,4 +224,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windowHandler.Po@am__quote@
 
Index: /orxonox/branches/osX/importer/framework.cc
===================================================================
--- /orxonox/branches/osX/importer/framework.cc	(revision 2976)
+++ /orxonox/branches/osX/importer/framework.cc	(revision 2977)
@@ -1,15 +1,18 @@
-#include "windowHandler.h" // Include the Whandler Basecode
-#include "object.h"
+#include "framework.h"
 
 int verbose = 1;
-WindowHandler wHandler;  // Create an instance of the whandler basecode class
-Object* obj;
-float rotator = 0.0;
-  GLfloat whiteLight[] = {1.0, 1.0, 0.0,1.0};
 
 void DrawGLScene()
 {
-  rotator +=.001;
-  
+  currFrame = SDL_GetTicks();
+  dt = currFrame - lastFrame; 
+  if (dt == 0)
+    dist += (zoomTo-dist)/500;
+  else 
+    dist += (zoomTo-dist)/500 *(float)dt;
+
+  rotatorP += rotatorV *(float)dt;
+  
+
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
   glLoadIdentity(); // Reset the view
@@ -17,16 +20,17 @@
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();	
-  gluPerspective(45.0f,500/375,0.1f,100.0f);
-  gluLookAt (5*sin(rotator),7.5,5*cos(rotator), 0,0,0, 0,1,0);
-  whiteLight[1] = .5+.5*sin(rotator*10);
-  whiteLight[2] = .5+.5*sin(rotator*10);
-
-  GLfloat lightPosition[] = {10.0*sin(rotator*10), 10, 19.0, 0.0};
-  glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
-
-  glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteLight);
+  gluPerspective(45.0f,500/375,0.1f,dist * 5.0f);
+    gluLookAt (0, dist , dist, 0,0,0, up.x,up.y,up.z);
+
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  //  glRotatef (180, dir.x, dir.y, dir.z);
+  glMultMatrixf (*matQ);
   obj->draw();
 
+  glPopMatrix();
+
   SDL_GL_SwapBuffers(); // Swap the buffers
+  lastFrame = currFrame;
 }
 
@@ -46,4 +50,6 @@
     return 0;
   }
+  
+  printf ("%i, %i\n", wHandler.screen->w, wHandler.screen->h);
   if (argc>=3)
     obj = new Object (argv[1], atof(argv[2]));
@@ -53,14 +59,40 @@
     obj = new Object();
   
+  M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0); 
+  rotAxis = Vector (0.0,1.0,0.0);
+  rotAngle = 0;
+
+  matQ[0][0] = matQ[1][1] = matQ[2][2] = matQ[3][3] = 1;
+  rotQ = Quaternion (rotAngle, rotAxis);
+  rotQlast = rotQ;
+  dir = Vector (0.0, 0.0, 1.0);
+  up = Vector (0.0, 1.0, 0.0);
+
+  glEnable(GL_LIGHTING);
+  glEnable(GL_DEPTH_TEST);
+
+  GLfloat whiteLight[] = {1.0, 1.0, 1.0,1.0};
+  GLfloat light0Position[] = {10.0, 10.0, 10.0, 0.0};
+  GLfloat light1Position[] = {-10.0, -7.0, -6.0, 0.0};
   GLfloat lmodelAmbient[] = {.1, .1, .1, 1.0};
+
+  glEnable(GL_LIGHT0);
+  glLightfv(GL_LIGHT0, GL_POSITION, light0Position);
   glLightfv(GL_LIGHT0, GL_DIFFUSE, whiteLight);
   glLightfv(GL_LIGHT0, GL_SPECULAR, whiteLight);
-  glEnable(GL_LIGHTING);
-  glEnable(GL_LIGHT0);
-  glEnable(GL_DEPTH_TEST);
-
+  
+  glEnable(GL_LIGHT1);
+  glLightfv(GL_LIGHT1, GL_POSITION, light1Position);
+  glLightfv(GL_LIGHT1, GL_DIFFUSE, whiteLight);
+  glLightfv(GL_LIGHT1, GL_SPECULAR, whiteLight);
+  
+  rotatorP = .0;
+  rotatorV = .0;
+  dist = 5.0;
+  zoomTo = dist;
   // Build the font from a TGA image font.tga in the data directory
   // Hide the mouse cursor
-  SDL_ShowCursor(0);
+    SDL_ShowCursor(2);
+    mouse1Down = false;
 
   // This is the main loop for the entire program and it will run until done==TRUE
@@ -73,4 +105,85 @@
     while ( SDL_PollEvent(&event) ) {
       switch (event.type) {
+      case SDL_MOUSEMOTION:
+	if (verbose >=3)
+	  printf("Mouse motion about %d,%d Pixels to (%d,%d).\n", 
+		 event.motion.xrel, event.motion.yrel,
+		 event.motion.x, event.motion.y);
+	// TRACKBALL
+	if (mouse1Down)
+	  {
+	    int mX = event.button.x;
+	    int mY = event.button.y;
+	    int wH = wHandler.screen->h;
+	    int wW = wHandler.screen->w;
+	    Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) ));
+	    //	    printf ("tmpV: %f, %f, %f\n", tmpV.x, tmpV.y, tmpV.z);
+	    p2 = tmpV-M;
+	    p2.y = -p2.y;
+	    rotAxis = p1.cross(p2);
+	    //  printf ("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z);
+
+	    // in case that there is no rotation-axis defined
+	    if (rotAxis.x != 0 || rotAxis.y != 0 || rotAxis.z != 0)
+	      {
+		rotAxis.normalize();
+		//		printf ("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z, rotAngle);
+				
+		rotAngle = angle_rad (p1, p2);
+		rotQ = Quaternion (rotAngle, rotAxis);
+		rotQ = rotQ * rotQlast;
+		rotQ.matrix (matQ);
+		//	dir = rotQ.apply(dir);
+		//      dir.normalize();
+		//	printf ("rotAxis: %f, %f, %f, %f\n", dir.x, dir.y, dir.z, rotAngle);
+	      }
+	    rotQlast = rotQ;
+	    p1 = p2;
+
+	  }
+	break;
+      case SDL_MOUSEBUTTONDOWN:
+	if (event.button.button == 4)
+	  {
+	    printf("MouseWheel up\n");
+	    zoomTo *= .5;
+	  }
+	else if (event.button.button == 5)
+	  {
+	    printf("MouseWheel down\n");
+	    zoomTo *= 2.0;
+	  }
+	else if (event.button.button == 1)
+	  {
+	    mouse1Down = true;
+	    int mX = event.button.x;
+	    int mY = event.button.y;
+	    int wH = wHandler.screen->h;
+	    int wW = wHandler.screen->w;
+	    Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) ));
+	    p1 = tmpV-M;
+	    p1.y = -p1.y;
+
+	  }
+	else
+	  {
+	    printf("MouseButton %d pressed at (%d,%d).\n",
+		   event.button.button, event.button.x, event.button.y);
+	    rotatorV = ( (float)wHandler.screen->w/2 -event.button.x) / (float)wHandler.screen->w / 100.0;
+	  }
+	    
+	break;
+      case SDL_MOUSEBUTTONUP:
+	if (event.button.button == 4);
+	else if (event.button.button == 5);
+	else if (event.button.button == 1)
+	  mouse1Down =false;
+	else 
+	    {
+	printf("MouseButton %d released at (%d,%d).\n",
+	       event.button.button, event.button.x, event.button.y);
+	    }
+	break;
+	    
         // If a quit event was recieved
       case SDL_QUIT:
@@ -81,4 +194,6 @@
           break;
       }
+
+
     }
 
Index: /orxonox/branches/osX/importer/framework.h
===================================================================
--- /orxonox/branches/osX/importer/framework.h	(revision 2977)
+++ /orxonox/branches/osX/importer/framework.h	(revision 2977)
@@ -0,0 +1,38 @@
+#ifndef _FRAMEWORK_H
+#define _FRAMEWORK_H
+ 
+#include "windowHandler.h" // Include the Whandler Basecode
+#include "object.h"
+#include "vector.h"
+
+float rotatorP;
+float rotatorV;
+
+float dist;
+float zoomTo;
+
+Uint32 lastFrame;
+Uint32 currFrame;
+Uint32 dt;
+
+
+Vector dir;
+Vector up;
+
+float matQ[4][4];
+
+Vector M;
+Vector p1;
+Vector p2;
+Vector rotAxis;
+float rotAngle;
+Quaternion rotQ;
+Quaternion rotQlast;
+
+bool mouse1Down;
+
+WindowHandler wHandler;  // Create an instance of the whandler basecode class
+Object* obj;
+
+
+#endif /* _FRAMEWORK_H */
Index: /orxonox/branches/osX/importer/object.cc
===================================================================
--- /orxonox/branches/osX/importer/object.cc	(revision 2976)
+++ /orxonox/branches/osX/importer/object.cc	(revision 2977)
@@ -48,5 +48,4 @@
    \param scaling The factor that the object will be scaled with.
 */
-
 Object::Object(char* fileName, float scaling)
 {
@@ -90,10 +89,10 @@
   groupCount = 0;
   
-  initGroup (currentGroup);
+  initGroup (firstGroup);
   mtlFileName = "";
   scaleFactor = 1;
   material = new Material();
 
-  glEnableClientState (GL_VERTEX_ARRAY);
+  //  glEnableClientState (GL_VERTEX_ARRAY);
   //  glEnableClientState (GL_NORMAL_ARRAY);
   //  glEnableClientState (GL_TEXTURE_COORD_ARRAY);
@@ -226,5 +225,5 @@
   group->name = "";
   group->faceMode = -1;
-  group->faceCount =0;  
+  group->faceCount = 0;  
   if ((group->listNumber = glGenLists(1)) == 0 )
     {
@@ -237,5 +236,5 @@
       group->firstVertex = 0;
       group->firstNormal = 0;
-      group->firstNormal = 0;
+      group->firstVertexTexture = 0;
     }
   else
@@ -265,4 +264,5 @@
   glEndList();
 }
+
 /**
    \brief deletes the Arrays of the Group to save space.
@@ -295,8 +295,8 @@
     }
   objFileName = fileName;
-  char Buffer[500];
+  char Buffer[10000];
   while(!OBJ_FILE->eof())
     {
-      OBJ_FILE->getline(Buffer, 500);
+      OBJ_FILE->getline(Buffer, 10000);
       if (verbose >=4)
 	printf ("Read input line: %s\n",Buffer);
@@ -377,7 +377,7 @@
     {
       currentGroup->vertices->finalizeArray();
-      glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray());
+      //      glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray());
       currentGroup->normals->finalizeArray();
-      glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray());
+      //      glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray());
       currentGroup->vTexture->finalizeArray();
     }
@@ -385,10 +385,29 @@
   readingVertices = false;
   currentGroup->faceCount++;
-  char subbuffer1[20];
-  char subbuffer2[20];
-  char subbuffer3[20];
-  char subbuffer4[20] ="";
-  sscanf (faceString, "%s %s %s %s", subbuffer1, subbuffer2, subbuffer3, subbuffer4);
-  if (!strcmp(subbuffer4, ""))
+
+  int elemCount = 0;
+  
+  FaceElement* firstElem = new FaceElement;
+  FaceElement* tmpElem = firstElem;
+
+  
+  while(strcmp (faceString, "\0"))
+    {
+      if (elemCount>0)
+	  tmpElem = tmpElem->next = new FaceElement;
+      tmpElem->next = NULL;
+
+
+      sscanf (faceString, "%s", tmpElem->value);
+      faceString += strlen(tmpElem->value);
+      if (strcmp (faceString, "\0"))
+	faceString++;
+      elemCount++;
+
+
+    }
+  
+  
+  if (elemCount == 3)
     {
       if (currentGroup->faceMode != 3)
@@ -401,11 +420,8 @@
       currentGroup->faceMode = 3;
       if (verbose >=3)
-	printf ("found triag: %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3);
-      addGLElement(subbuffer1);
-      addGLElement(subbuffer2);
-      addGLElement(subbuffer3);
-      return true;
-    }
-  else
+	printf ("found triag.\n");
+    }
+  
+  else if (elemCount == 4)
     {
       if (currentGroup->faceMode != 4)
@@ -417,11 +433,28 @@
       currentGroup->faceMode = 4;
       if (verbose >=3 )
-	printf ("found quad: %s, %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3, subbuffer4);
-      addGLElement(subbuffer1);
-      addGLElement(subbuffer2);
-      addGLElement(subbuffer3);
-      addGLElement(subbuffer4);
-      return true;
-    }
+	printf ("found quad.\n");
+    }
+  
+  else if (elemCount > 4)
+    {
+      if (currentGroup->faceMode != -1)
+	glEnd();
+      glBegin(GL_POLYGON);
+      if (verbose >=3)
+	printf ("Polygon with %i faces found.", elemCount);
+      currentGroup->faceMode = elemCount;
+    }
+
+  tmpElem = firstElem;
+  FaceElement* delElem;
+  while (tmpElem != NULL)
+    {
+      //      printf ("%s\n", tmpElem->value);
+      addGLElement(tmpElem->value);
+      delElem = tmpElem;
+      tmpElem = tmpElem->next;
+      delete delElem;
+    }
+
 }
 
@@ -442,18 +475,20 @@
 
   char* texture;
-  texture = strstr (vertex, "/");
-  texture[0] = '\0';
-  texture ++;
-  if (verbose>=3)
-    printf ("includeing texture #%i, and mapping it to group texture #%i, textureArray has %i entries.\n", atoi(texture), (atoi(texture)-1 - currentGroup->firstVertexTexture)*3, currentGroup->vTexture->getCount());
-  glTexCoord2fv(currentGroup->vTexture->getArray()+(atoi(texture)-1 - currentGroup->firstVertexTexture)*2);
-
-  char* normal;
-  if ((normal = strstr (texture, "/")) !=NULL)
-    {
-      normal[0] = '\0';
-      normal ++;
-      //glArrayElement(atoi(vertex)-1);
-      glNormal3fv(currentGroup->normals->getArray() +(atoi(normal)-1 - currentGroup->firstNormal)*3);
+  if ((texture = strstr (vertex, "/")) != NULL)
+    {
+      texture[0] = '\0';
+      texture ++;
+      if (verbose>=3)
+	printf ("includeing texture #%i, and mapping it to group texture #%i, textureArray has %i entries.\n", atoi(texture), (atoi(texture)-1 - currentGroup->firstVertexTexture)*2, currentGroup->vTexture->getCount());
+      glTexCoord2fv(currentGroup->vTexture->getArray()+(atoi(texture)-1 - currentGroup->firstVertexTexture)*2);
+
+      char* normal;
+      if ((normal = strstr (texture, "/")) !=NULL)
+	{
+	  normal[0] = '\0';
+	  normal ++;
+	  //glArrayElement(atoi(vertex)-1);
+	  glNormal3fv(currentGroup->normals->getArray() +(atoi(normal)-1 - currentGroup->firstNormal)*3);
+	}
     }
   if (verbose>=3)
@@ -603,5 +638,4 @@
    \param matString the Material that will be set.
 */
-
 bool Object::readUseMtl (char* matString)
 {
@@ -635,4 +669,5 @@
   readVertex ("-0.500000 -0.500000 -0.500000");
   readVertex ("0.500000 -0.500000 -0.500000");
+
   readVertexTexture ("0.000000 0.000000");
   readVertexTexture ("1.000000 0.000000");
Index: /orxonox/branches/osX/importer/object.h
===================================================================
--- /orxonox/branches/osX/importer/object.h	(revision 2976)
+++ /orxonox/branches/osX/importer/object.h	(revision 2977)
@@ -18,4 +18,10 @@
 extern int verbose; //!< fill be removed and added again as a verbose-class
 
+
+struct FaceElement
+{
+  char value[20];
+  FaceElement* next;
+};
 
 //! Class that handles 3D-Objects. it can also read them in and display them.
Index: /orxonox/branches/osX/importer/vector.cc
===================================================================
--- /orxonox/branches/osX/importer/vector.cc	(revision 2977)
+++ /orxonox/branches/osX/importer/vector.cc	(revision 2977)
@@ -0,0 +1,844 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Christian Meyer 
+   co-programmer: Patrick Boenzli : Vector::scale()
+                                    Vector::abs()
+   
+   Quaternion code borrowed from an Gamasutra article by Nick Bobick and Ken Shoemake
+*/
+
+
+#include "vector.h"
+
+
+using namespace std;
+
+/**
+   \brief add two vectors
+   \param v: the other vector
+   \return the sum of both vectors
+*/
+Vector Vector::operator+ (const Vector& v) const
+{
+  Vector r;
+
+  r.x = x + v.x;
+  r.y = y + v.y;
+  r.z = z + v.z;
+  
+  return r;
+}
+
+/**
+   \brief subtract a vector from another
+   \param v: the other vector
+   \return the difference between the vectors
+*/
+Vector Vector::operator- (const Vector& v) const
+{
+  Vector r;
+  
+  r.x = x - v.x;
+  r.y = y - v.y;
+  r.z = z - v.z;
+  
+  return r;
+}
+
+/**
+   \brief calculate the dot product of two vectors
+   \param v: the other vector
+   \return the dot product of the vectors
+*/
+float Vector::operator* (const Vector& v) const
+{
+  return x*v.x+y*v.y+z*v.z;
+}
+
+/**
+   \brief multiply a vector with a float
+   \param f: the factor
+   \return the vector multipied by f
+*/
+Vector Vector::operator* (float f) const
+{  
+  Vector r;
+  
+  r.x = x * f;
+  r.y = y * f;
+  r.z = z * f;
+  
+  return r;
+}
+
+/**
+   \brief divide a vector with a float
+   \param f: the divisor
+   \return the vector divided by f   
+*/
+Vector Vector::operator/ (float f) const
+{
+  Vector r;
+  
+  if( f == 0.0)
+  {
+    // Prevent divide by zero
+    return Vector (0,0,0);
+  }
+  
+  r.x = x / f;
+  r.y = y / f;
+  r.z = z / f;
+  
+  return r;
+}
+
+/**
+   \brief calculate the dot product of two vectors
+   \param v: the other vector
+   \return the dot product of the vectors
+*/
+float Vector::dot (const Vector& v) const
+{
+  return x*v.x+y*v.y+z*v.z;
+}
+
+/**
+  \brief calculate the cross product of two vectors
+  \param v: the other vector
+	\return the cross product of the vectors
+*/
+Vector Vector::cross (const Vector& v) const
+{
+  Vector r;
+  
+  r.x = y * v.z - z * v.y;
+  r.y = z * v.x - x * v.z;
+  r.z = x * v.y - y * v.x;
+  
+  return r;
+}
+  
+/**
+   \brief normalizes the vector to lenght 1.0
+*/
+void Vector::normalize ()
+{
+  float l = len();
+  
+  if( l == 0.0)
+  {
+    // Prevent divide by zero
+    return;
+  }
+  
+  x = x / l;
+  y = y / l;
+  z = z / l;
+}
+
+
+/**
+   \bref returns the voctor normalized to length 1.0
+*/
+
+Vector* Vector::getNormalized()
+{
+  float l = len();
+  if(l != 1.0)
+    {
+      return this;
+    }
+  else if(l == 0.0)
+    {
+      return 0;
+    }
+  
+  Vector *normalizedVector = new Vector(x / l, y /l, z / l);
+  return normalizedVector;
+}
+
+
+void Vector::scale(const Vector& v)
+{
+  x *= v.x;
+  y *= v.y;
+  z *= v.z;
+}
+
+ 
+/**
+   \brief calculates the lenght of the vector
+   \return the lenght of the vector
+*/
+float Vector::len () const
+{
+  return sqrt (x*x+y*y+z*z);
+}
+
+
+
+Vector Vector::abs() 
+{
+  Vector v(fabs(x), fabs(y), fabs(z));
+  return v;
+}
+
+
+/**
+   \brief calculate the angle between two vectors in radiances
+   \param v1: a vector
+   \param v2: another vector
+   \return the angle between the vectors in radians
+*/
+float angle_rad (const Vector& v1, const Vector& v2)
+{
+  return acos( v1 * v2 / (v1.len() * v2.len()));
+}
+
+
+/**
+   \brief calculate the angle between two vectors in degrees
+   \param v1: a vector
+   \param v2: another vector
+   \return the angle between the vectors in degrees
+*/
+float angle_deg (const Vector& v1, const Vector& v2)
+{
+  float f;
+  f = acos( v1 * v2 / (v1.len() * v2.len()));
+  return f * 180 / PI;
+}
+
+/**
+	\brief creates a multiplicational identity Quaternion
+*/
+Quaternion::Quaternion ()
+{
+	w = 1;
+	v = Vector(0,0,0);
+}
+
+/**
+	\brief turns a rotation along an axis into a Quaternion
+	\param angle: the amount of radians to rotate
+	\param axis: the axis to rotate around
+*/
+Quaternion::Quaternion (float angle, const Vector& axis)
+{
+	w = cos(angle/2);
+	v = axis * sin(angle/2);
+}
+
+/**
+   \brief calculates a look_at rotation
+   \param dir: the direction you want to look
+   \param up: specify what direction up should be
+   
+   Mathematically this determines the rotation a (0,0,1)-Vector has to undergo to point
+   the same way as dir. If you want to use this with cameras, you'll have to reverse the
+   dir Vector (Vector(0,0,0) - your viewing direction) or you'll point the wrong way. You
+   can use this for meshes as well (then you do not have to reverse the vector), but keep 
+   in mind that if you do that, the model's front has to point in +z direction, and left 
+   and right should be -x or +x respectively or the mesh wont rotate correctly.
+*/
+Quaternion::Quaternion (const Vector& dir, const Vector& up)
+{
+  Vector z = dir;
+  z.normalize(); 
+  Vector x = up.cross(z);
+  x.normalize(); 
+  Vector y = z.cross(x);
+  
+  float m[4][4];
+  m[0][0] = x.x;
+  m[0][1] = x.y;
+  m[0][2] = x.z;
+  m[0][3] = 0;
+  m[1][0] = y.x;
+  m[1][1] = y.y;
+  m[1][2] = y.z;
+  m[1][3] = 0;
+  m[2][0] = z.x;
+  m[2][1] = z.y;
+  m[2][2] = z.z;
+  m[2][3] = 0;
+  m[3][0] = 0;
+  m[3][1] = 0;
+  m[3][2] = 0;
+  m[3][3] = 1;
+  
+  *this = Quaternion (m);
+}
+
+/**
+	\brief calculates a rotation from euler angles
+	\param roll: the roll in radians
+	\param pitch: the pitch in radians
+	\param yaw: the yaw in radians
+	
+	I DO HONESTLY NOT EXACTLY KNOW WHICH ANGLE REPRESENTS WHICH ROTATION. And I do not know 
+	in what order they are applied,	I just copy-pasted the code.
+*/
+Quaternion::Quaternion (float roll, float pitch, float yaw)
+{
+	float cr, cp, cy, sr, sp, sy, cpcy, spsy;
+	
+	// calculate trig identities
+	cr = cos(roll/2);
+	cp = cos(pitch/2);
+	cy = cos(yaw/2);
+	
+	sr = sin(roll/2);
+	sp = sin(pitch/2);
+	sy = sin(yaw/2);
+	
+	cpcy = cp * cy;
+	spsy = sp * sy;
+	
+	w = cr * cpcy + sr * spsy;
+	v.x = sr * cpcy - cr * spsy;
+	v.y = cr * sp * cy + sr * cp * sy;
+	v.z = cr * cp * sy - sr * sp * cy;
+}
+
+/**
+	\brief rotates one Quaternion by another
+	\param q: another Quaternion to rotate this by
+	\return a quaternion that represents the first one rotated by the second one (WARUNING: this operation is not commutative! e.g. (A*B) != (B*A))
+*/
+Quaternion Quaternion::operator*(const Quaternion& q) const
+{
+	float A, B, C, D, E, F, G, H;
+	Quaternion r;
+	
+	A = (w   + v.x)*(q.w   + q.v.x);
+	B = (v.z - v.y)*(q.v.y - q.v.z);
+	C = (w   - v.x)*(q.v.y + q.v.z); 
+	D = (v.y + v.z)*(q.w   - q.v.x);
+	E = (v.x + v.z)*(q.v.x + q.v.y);
+	F = (v.x - v.z)*(q.v.x - q.v.y);
+	G = (w   + v.y)*(q.w   - q.v.z);
+	H = (w   - v.y)*(q.w   + q.v.z);
+	
+	r.w = B +  (-E - F + G + H)/2;
+	r.v.x = A - (E + F + G + H)/2; 
+	r.v.y = C + (E - F + G - H)/2; 
+	r.v.z = D + (E - F - G + H)/2;
+	
+	return r;
+}
+
+/**
+	\brief add two Quaternions
+	\param q: another Quaternion
+	\return the sum of both Quaternions
+*/
+Quaternion Quaternion::operator+(const Quaternion& q) const
+{
+	Quaternion r(*this);
+	r.w = r.w + q.w;
+	r.v = r.v + q.v;
+	return r;
+}
+
+/**
+	\brief subtract two Quaternions
+	\param q: another Quaternion
+	\return the difference of both Quaternions
+*/
+Quaternion Quaternion::operator- (const Quaternion& q) const
+{
+	Quaternion r(*this);
+	r.w = r.w - q.w;
+	r.v = r.v - q.v;
+	return r;
+}
+
+/**
+	\brief rotate a Vector by a Quaternion
+	\param v: the Vector
+	\return a new Vector representing v rotated by the Quaternion
+*/
+Vector Quaternion::apply (Vector& v) const
+{
+	Quaternion q;
+	q.v = v;
+	q.w = 0;
+	q = *this * q * conjugate();
+	return q.v;
+}
+
+/**
+	\brief multiply a Quaternion with a real value
+	\param f: a real value
+	\return a new Quaternion containing the product
+*/
+Quaternion Quaternion::operator*(const float& f) const
+{
+	Quaternion r(*this);
+	r.w = r.w*f;
+	r.v = r.v*f;
+	return r;
+}
+
+/**
+	\brief divide a Quaternion by a real value
+	\param f: a real value
+	\return a new Quaternion containing the quotient
+*/
+Quaternion Quaternion::operator/(const float& f) const
+{
+	if( f == 0) return Quaternion();
+	Quaternion r(*this);
+	r.w = r.w/f;
+	r.v = r.v/f;
+	return r;
+}
+
+/**
+	\brief calculate the conjugate value of the Quaternion
+	\return the conjugate Quaternion
+*/
+Quaternion Quaternion::conjugate() const
+{
+	Quaternion r(*this);
+	r.v = Vector() - r.v;
+	return r;
+}
+
+/**
+	\brief calculate the norm of the Quaternion
+	\return the norm of The Quaternion
+*/
+float Quaternion::norm() const
+{
+	return w*w + v.x*v.x + v.y*v.y + v.z*v.z;
+}
+
+/**
+	\brief calculate the inverse value of the Quaternion
+	\return the inverse Quaternion
+	
+	Note that this is equal to conjugate() if the Quaternion's norm is 1
+*/
+Quaternion Quaternion::inverse() const
+{
+	float n = norm();
+	if (n != 0)
+	{
+		return conjugate() / norm();
+	}
+	else return Quaternion();
+}
+
+/**
+	\brief convert the Quaternion to a 4x4 rotational glMatrix
+	\param m: a buffer to store the Matrix in
+*/
+void Quaternion::matrix (float m[4][4]) const
+{
+  float wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2; 
+  
+  // calculate coefficients
+  x2 = v.x + v.x;
+  y2 = v.y + v.y; 
+  z2 = v.z + v.z;
+  xx = v.x * x2; xy = v.x * y2; xz = v.x * z2;
+  yy = v.y * y2; yz = v.y * z2; zz = v.z * z2;
+  wx = w * x2; wy = w * y2; wz = w * z2;
+  
+  m[0][0] = 1.0 - (yy + zz); m[1][0] = xy - wz;
+  m[2][0] = xz + wy; m[3][0] = 0.0;
+	
+  m[0][1] = xy + wz; m[1][1] = 1.0 - (xx + zz);
+  m[2][1] = yz - wx; m[3][1] = 0.0;
+  
+  m[0][2] = xz - wy; m[1][2] = yz + wx;
+  m[2][2] = 1.0 - (xx + yy); m[3][2] = 0.0;
+  
+  m[0][3] = 0; m[1][3] = 0;
+  m[2][3] = 0; m[3][3] = 1;
+}
+
+
+void Quaternion::quatSlerp(const Quaternion* from, const Quaternion* to, float t, Quaternion* res)
+{
+  float tol[4];
+  double omega, cosom, sinom, scale0, scale1;
+  DELTA = 0.2;
+
+  cosom = from->v.x * to->v.x + from->v.y * to->v.y + from->v.z * to->v.z + from->w * to->w;
+
+  if( cosom < 0.0 ) 
+    { 
+      cosom = -cosom; 
+      tol[0] = -to->v.x;
+      tol[1] = -to->v.y;
+      tol[2] = -to->v.z;
+      tol[3] = -to->w;
+    }
+  else
+    {
+      tol[0] = to->v.x;
+      tol[1] = to->v.y;
+      tol[2] = to->v.z;
+      tol[3] = to->w;
+    }
+  
+  //if( (1.0 - cosom) > DELTA )
+  //{
+      omega = acos(cosom);
+      sinom = sin(omega);
+      scale0 = sin((1.0 - t) * omega) / sinom;
+      scale1 = sin(t * omega) / sinom;
+      //}
+      /*
+  else
+    {
+      scale0 = 1.0 - t;
+      scale1 = t;
+    }
+      */
+  res->v.x = scale0 * from->v.x + scale1 * tol[0];
+  res->v.y = scale0 * from->v.y + scale1 * tol[1];
+  res->v.z = scale0 * from->v.z + scale1 * tol[2];
+  res->w = scale0 * from->w + scale1 * tol[3];
+}
+
+
+/**
+   \brief convert a rotational 4x4 glMatrix into a Quaternion
+   \param m: a 4x4 matrix in glMatrix order
+*/
+Quaternion::Quaternion (float m[4][4])
+{
+	
+  float  tr, s, q[4];
+  int    i, j, k;
+
+  int nxt[3] = {1, 2, 0};
+
+  tr = m[0][0] + m[1][1] + m[2][2];
+
+  	// check the diagonal
+  if (tr > 0.0) 
+  {
+    s = sqrt (tr + 1.0);
+    w = s / 2.0;
+    s = 0.5 / s;
+    v.x = (m[1][2] - m[2][1]) * s;
+    v.y = (m[2][0] - m[0][2]) * s;
+    v.z = (m[0][1] - m[1][0]) * s;
+	} 
+	else 
+	{
+ 		// diagonal is negative
+  	i = 0;
+  	if (m[1][1] > m[0][0]) i = 1;
+    if (m[2][2] > m[i][i]) i = 2;
+    j = nxt[i];
+    k = nxt[j];
+
+    s = sqrt ((m[i][i] - (m[j][j] + m[k][k])) + 1.0);
+      
+    q[i] = s * 0.5;
+            
+    if (s != 0.0) s = 0.5 / s;
+	
+	  q[3] = (m[j][k] - m[k][j]) * s;
+    q[j] = (m[i][j] + m[j][i]) * s;
+    q[k] = (m[i][k] + m[k][i]) * s;
+
+  	v.x = q[0];
+  	v.y = q[1];
+  	v.z = q[2];
+  	w = q[3];
+  }
+}
+
+/**
+   \brief create a rotation from a vector
+   \param v: a vector
+*/
+Rotation::Rotation (const Vector& v)
+{
+  Vector x = Vector( 1, 0, 0);
+  Vector axis = x.cross( v);
+  axis.normalize();
+  float angle = angle_rad( x, v);
+  float ca = cos(angle);
+  float sa = sin(angle);
+  m[0] = 1.0f+(1.0f-ca)*(axis.x*axis.x-1.0f);
+  m[1] = -axis.z*sa+(1.0f-ca)*axis.x*axis.y;
+  m[2] = axis.y*sa+(1.0f-ca)*axis.x*axis.z;
+  m[3] = axis.z*sa+(1.0f-ca)*axis.x*axis.y;
+  m[4] = 1.0f+(1.0f-ca)*(axis.y*axis.y-1.0f);
+  m[5] = -axis.x*sa+(1.0f-ca)*axis.y*axis.z;
+  m[6] = -axis.y*sa+(1.0f-ca)*axis.x*axis.z;
+  m[7] = axis.x*sa+(1.0f-ca)*axis.y*axis.z;
+  m[8] = 1.0f+(1.0f-ca)*(axis.z*axis.z-1.0f);
+}
+
+/**
+   \brief creates a rotation from an axis and an angle (radians!)
+   \param axis: the rotational axis
+   \param angle: the angle in radians
+*/
+Rotation::Rotation (const Vector& axis, float angle)
+{
+  float ca, sa;
+  ca = cos(angle);
+  sa = sin(angle);
+  m[0] = 1.0f+(1.0f-ca)*(axis.x*axis.x-1.0f);
+  m[1] = -axis.z*sa+(1.0f-ca)*axis.x*axis.y;
+  m[2] = axis.y*sa+(1.0f-ca)*axis.x*axis.z;
+  m[3] = axis.z*sa+(1.0f-ca)*axis.x*axis.y;
+  m[4] = 1.0f+(1.0f-ca)*(axis.y*axis.y-1.0f);
+  m[5] = -axis.x*sa+(1.0f-ca)*axis.y*axis.z;
+  m[6] = -axis.y*sa+(1.0f-ca)*axis.x*axis.z;
+  m[7] = axis.x*sa+(1.0f-ca)*axis.y*axis.z;
+  m[8] = 1.0f+(1.0f-ca)*(axis.z*axis.z-1.0f);
+}
+
+/**
+   \brief creates a rotation from euler angles (pitch/yaw/roll)
+   \param pitch: rotation around z (in radians)
+   \param yaw: rotation around y (in radians)
+   \param roll: rotation around x (in radians)
+*/
+Rotation::Rotation ( float pitch, float yaw, float roll)
+{
+  float cy, sy, cr, sr, cp, sp;
+  cy = cos(yaw);
+  sy = sin(yaw);
+  cr = cos(roll);
+  sr = sin(roll);
+  cp = cos(pitch);
+  sp = sin(pitch);
+  m[0] = cy*cr;
+  m[1] = -cy*sr;
+  m[2] = sy;
+  m[3] = cp*sr+sp*sy*cr;
+  m[4] = cp*cr-sp*sr*sy;
+  m[5] = -sp*cy;
+  m[6] = sp*sr-cp*sy*cr;
+  m[7] = sp*cr+cp*sy*sr;
+  m[8] = cp*cy;
+}
+
+/**
+   \brief creates a nullrotation (an identity rotation)
+*/
+Rotation::Rotation ()
+{
+  m[0] = 1.0f;
+  m[1] = 0.0f;
+  m[2] = 0.0f;
+  m[3] = 0.0f;
+  m[4] = 1.0f;
+  m[5] = 0.0f;
+  m[6] = 0.0f;
+  m[7] = 0.0f;
+  m[8] = 1.0f;
+}
+
+/**
+   \brief fills the specified buffer with a 4x4 glmatrix
+   \param buffer: Pointer to an array of 16 floats
+   
+   Use this to get the rotation in a gl-compatible format
+*/
+void Rotation::glmatrix (float* buffer)
+{
+	buffer[0] = m[0];
+	buffer[1] = m[3];
+	buffer[2] = m[6];
+	buffer[3] = m[0];
+	buffer[4] = m[1];
+	buffer[5] = m[4];
+	buffer[6] = m[7];
+	buffer[7] = m[0];
+	buffer[8] = m[2];
+	buffer[9] = m[5];
+	buffer[10] = m[8];
+	buffer[11] = m[0];
+	buffer[12] = m[0];
+	buffer[13] = m[0];
+	buffer[14] = m[0];
+	buffer[15] = m[1];
+}
+
+/**
+   \brief multiplies two rotational matrices
+   \param r: another Rotation
+   \return the matrix product of the Rotations
+   
+   Use this to rotate one rotation by another
+*/
+Rotation Rotation::operator* (const Rotation& r)
+{
+	Rotation p;
+	
+	p.m[0] = m[0]*r.m[0] + m[1]*r.m[3] + m[2]*r.m[6];
+	p.m[1] = m[0]*r.m[1] + m[1]*r.m[4] + m[2]*r.m[7];
+	p.m[2] = m[0]*r.m[2] + m[1]*r.m[5] + m[2]*r.m[8];
+	
+	p.m[3] = m[3]*r.m[0] + m[4]*r.m[3] + m[5]*r.m[6];
+	p.m[4] = m[3]*r.m[1] + m[4]*r.m[4] + m[5]*r.m[7];
+	p.m[5] = m[3]*r.m[2] + m[4]*r.m[5] + m[5]*r.m[8];
+
+	p.m[6] = m[6]*r.m[0] + m[7]*r.m[3] + m[8]*r.m[6];
+	p.m[7] = m[6]*r.m[1] + m[7]*r.m[4] + m[8]*r.m[7];
+	p.m[8] = m[6]*r.m[2] + m[7]*r.m[5] + m[8]*r.m[8];
+	
+	return p;
+}
+
+
+/**
+   \brief rotates the vector by the given rotation
+   \param v: a vector
+   \param r: a rotation
+   \return the rotated vector
+*/
+Vector rotate_vector( const Vector& v, const Rotation& r)
+{
+  Vector t;
+  
+  t.x = v.x * r.m[0] + v.y * r.m[1] + v.z * r.m[2];
+  t.y = v.x * r.m[3] + v.y * r.m[4] + v.z * r.m[5];
+  t.z = v.x * r.m[6] + v.y * r.m[7] + v.z * r.m[8];
+
+  return t;
+}
+
+/**
+   \brief calculate the distance between two lines
+   \param l: the other line
+   \return the distance between the lines
+*/
+float Line::distance (const Line& l) const
+{
+  float q, d;
+  Vector n = a.cross(l.a);
+  q = n.dot(r-l.r);
+  d = n.len();
+  if( d == 0.0) return 0.0;
+  return q/d;
+}
+
+/**
+   \brief calculate the distance between a line and a point
+   \param v: the point
+   \return the distance between the Line and the point
+*/
+float Line::distance_point (const Vector& v) const
+{
+  Vector d = v-r;
+  Vector u = a * d.dot( a);
+  return (d - u).len();
+}
+
+/**
+   \brief calculate the two points of minimal distance of two lines
+   \param l: the other line
+   \return a Vector[2] (!has to be deleted after use!) containing the two points of minimal distance
+*/
+Vector* Line::footpoints (const Line& l) const
+{
+  Vector* fp = new Vector[2];
+  Plane p = Plane (r + a.cross(l.a), r, r + a);
+  fp[1] = p.intersect_line (l);
+  p = Plane (fp[1], l.a);
+  fp[0] = p.intersect_line (*this);
+  return fp;
+}
+
+/**
+  \brief calculate the length of a line
+  \return the lenght of the line 
+*/
+float Line::len() const
+{
+  return a.len();
+}
+
+/**
+   \brief rotate the line by given rotation
+   \param rot: a rotation
+*/
+void Line::rotate (const Rotation& rot)
+{
+  Vector t = a + r;
+  t = rotate_vector( t, rot);
+  r = rotate_vector( r, rot),
+  a = t - r;
+}
+
+/**
+   \brief create a plane from three points
+   \param a: first point
+   \param b: second point
+   \param c: third point
+*/
+Plane::Plane (Vector a, Vector b, Vector c)
+{
+  n = (a-b).cross(c-b);
+  k = -(n.x*b.x+n.y*b.y+n.z*b.z);
+}
+
+/**
+   \brief create a plane from anchor point and normal
+   \param n: normal vector
+   \param p: anchor point
+*/
+Plane::Plane (Vector norm, Vector p)
+{
+  n = norm;
+  k = -(n.x*p.x+n.y*p.y+n.z*p.z);
+}
+
+/**
+   \brief returns the intersection point between the plane and a line
+   \param l: a line
+*/
+Vector Plane::intersect_line (const Line& l) const
+{
+  if (n.x*l.a.x+n.y*l.a.y+n.z*l.a.z == 0.0) return Vector(0,0,0);
+  float t = (n.x*l.r.x+n.y*l.r.y+n.z*l.r.z+k) / (n.x*l.a.x+n.y*l.a.y+n.z*l.a.z);
+  return l.r + (l.a * t);
+}
+
+/**
+   \brief returns the distance between the plane and a point
+   \param p: a Point
+   \return the distance between the plane and the point (can be negative)
+*/
+float Plane::distance_point (const Vector& p) const
+{
+  float l = n.len();
+  if( l == 0.0) return 0.0;
+  return (n.dot(p) + k) / n.len();
+}
+
+/**
+   \brief returns the side a point is located relative to a Plane
+   \param p: a Point
+   \return 0 if the point is contained within the Plane, positive(negative) if the point is in the positive(negative) semi-space of the Plane
+*/
+float Plane::locate_point (const Vector& p) const
+{
+  return (n.dot(p) + k);
+}
Index: /orxonox/branches/osX/importer/vector.h
===================================================================
--- /orxonox/branches/osX/importer/vector.h	(revision 2977)
+++ /orxonox/branches/osX/importer/vector.h	(revision 2977)
@@ -0,0 +1,151 @@
+/*! 
+    \file vector.h
+    \brief A basic 3D math framework
+    
+    Contains classes to handle vectors, lines, rotations and planes
+*/ 
+
+#ifndef VECTOR_H
+#define VECTOR_H
+
+#include <math.h>
+#define PI 3.14159265359f
+
+//! 3D Vector
+/**
+	Class to handle 3D Vectors
+*/
+class Vector {
+
+  public:
+ 
+  float x, y, z;
+
+  Vector (float x, float y, float z) : x(x), y(y), z(z) {}  //!< assignment constructor
+  Vector () : x(0), y(0), z(0) {}
+  ~Vector () {}
+
+  Vector operator+ (const Vector& v) const;
+  Vector operator- (const Vector& v) const;
+  float operator* (const Vector& v) const;
+  Vector operator* (float f) const;
+  Vector operator/ (float f) const;
+  float dot (const Vector& v) const;
+  Vector cross (const Vector& v) const;
+  void scale(const Vector& v);
+  float len() const;
+  void normalize();
+  Vector* getNormalized();
+  Vector abs();
+};
+
+float angle_deg (const Vector& v1, const Vector& v2);
+float angle_rad (const Vector& v1, const Vector& v2);
+
+//! Quaternion
+/**
+	Class to handle 3-dimensional rotation efficiently
+*/
+class Quaternion
+{
+ public:
+	Vector v;	//!< Imaginary Vector
+	float w; //!< Real part of the number
+
+ 	Quaternion ();
+ 	Quaternion (float m[4][4]);
+ 	Quaternion (float angle, const Vector& axis);
+ 	Quaternion (const Vector& dir, const Vector& up);
+ 	Quaternion (float roll, float pitch, float yaw);
+ 	
+ 	Quaternion operator/ (const float& f) const;
+ 	Quaternion operator* (const float& f) const;
+ 	Quaternion operator* (const Quaternion& q) const;
+	Quaternion operator+ (const Quaternion& q) const;
+	Quaternion operator- (const Quaternion& q) const;
+	Quaternion conjugate () const;
+	Quaternion inverse () const;
+ 	Vector apply (Vector& f) const;
+	float norm () const;
+	void matrix (float m[4][4]) const;
+	void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);
+
+ private:
+	float DELTA;
+
+};
+
+//! 3D rotation (OBSOLETE)
+/**
+  Class to handle 3-dimensional rotations.
+  Can create a rotation from several inputs, currently stores rotation using a 3x3 Matrix
+*/
+class Rotation {
+  public:
+  
+  float m[9]; //!< 3x3 Rotation Matrix
+  
+  Rotation ( const Vector& v);
+  Rotation ( const Vector& axis, float angle);
+  Rotation ( float pitch, float yaw, float roll);
+  Rotation ();
+  ~Rotation () {}
+  
+  Rotation operator* (const Rotation& r);
+  
+  void glmatrix (float* buffer);
+};
+
+//!< Apply a rotation to a vector
+Vector rotate_vector( const Vector& v, const Rotation& r);
+
+//! 3D line
+/**
+  Class to store Lines in 3-dimensional space
+
+  Supports line-to-line distance measurements and rotation
+*/
+class Line
+{
+  public:
+  
+  Vector r;   //!< Offset
+  Vector a;   //!< Direction
+  
+  Line ( Vector r, Vector a) : r(r), a(a) {}  //!< assignment constructor
+  Line () : r(Vector(0,0,0)), a(Vector (1,1,1)) {}
+  ~Line () {}
+  
+  float distance (const Line& l) const;
+  float distance_point (const Vector& v) const;
+  Vector* footpoints (const Line& l) const;
+  float len () const;
+  
+  void rotate(const Rotation& rot);
+};
+
+//! 3D plane
+/**
+  Class to handle planes in 3-dimensional space
+  
+  Critical for polygon-based collision detection
+*/
+class Plane
+{
+  public:
+  
+  Vector n;   //!< Normal vector
+  float k;    //!< Offset constant
+  
+  Plane (Vector a, Vector b, Vector c);
+  Plane (Vector norm, Vector p);
+  Plane (Vector n, float k) : n(n), k(k) {} //!< assignment constructor
+  Plane () : n(Vector(1,1,1)), k(0) {}
+  ~Plane () {}
+  
+  Vector intersect_line (const Line& l) const;
+  float distance_point (const Vector& p) const;
+  float locate_point (const Vector& p) const;
+};
+
+#endif
Index: /orxonox/branches/osX/importer/windowHandler.cc
===================================================================
--- /orxonox/branches/osX/importer/windowHandler.cc	(revision 2976)
+++ /orxonox/branches/osX/importer/windowHandler.cc	(revision 2977)
@@ -3,15 +3,15 @@
 #include "windowHandler.h"
 #include <stdio.h>
-void WindowHandler::ReSizeGLScene(GLsizei width, GLsizei height)		// Resize And Initialize The GL Window
+void WindowHandler::ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize The GL Window
 {
-	if (height==0)										// Prevent A Divide By Zero By
+	if (height==0)	// Prevent A Divide By Zero By
 	{
-		height=1;										// Making Height Equal One
+		height=1;// Making Height Equal One
 	}
 
-	glViewport(0,0,width,height);						// Reset The Current Viewport
+	glViewport(0,0,width,height); // Reset The Current Viewport
 
-
-	glMatrixMode(GL_PROJECTION);						// Select The Projection Matrix
+	
+	glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
 	glLoadIdentity();	
 
@@ -21,6 +21,6 @@
 	gluLookAt (0,0,15, 0,0,0, 0,1,0);
 
-	glMatrixMode(GL_MODELVIEW);							// Select The Modelview Matrix
-	glLoadIdentity();									// Reset The Modelview Matrix
+	glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
+	glLoadIdentity(); // Reset The Modelview Matrix
 
 }
@@ -29,11 +29,11 @@
 int WindowHandler::InitGL(GLvoid)										// All Setup For OpenGL Goes Here
 {
-	glEnable(GL_TEXTURE_2D);							// Enable Texture Mapping
-	glShadeModel(GL_SMOOTH);							// Enable Smooth Shading
-	glClearColor(0.00f, 0.00f, 0.00f, 0.0f);			// Black Background
-	glClearDepth(1.0f);									// Depth Buffer Setup
-	glEnable(GL_DEPTH_TEST);							// Enables Depth Testing
-	glDepthFunc(GL_LEQUAL);								// The Type Of Depth Testing To Do
-	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	// Really Nice Perspective Calculations
+	glEnable(GL_TEXTURE_2D); // Enable Texture Mapping
+	glShadeModel(GL_SMOOTH); // Enable Smooth Shading
+	glClearColor(0.00f, 0.00f, 0.00f, 0.0f); // Black Background
+	glClearDepth(1.0f);  // Depth Buffer Setup
+	glEnable(GL_DEPTH_TEST); // Enables Depth Testing
+	glDepthFunc(GL_LEQUAL);	// The Type Of Depth Testing To Do
+	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);  // Really Nice Perspective Calculations
 
     return TRUE;
@@ -41,5 +41,5 @@
 
 
-GLvoid WindowHandler::KillGLWindow(GLvoid)								// Properly Kill The Window
+GLvoid WindowHandler::KillGLWindow(GLvoid) // Properly Kill The Window
 {
 	SDL_Quit();
@@ -63,18 +63,18 @@
 	}
 	SDL_GL_SetAttribute( SDL_GL_STENCIL_SIZE, 1 );
-	if ( SDL_SetVideoMode(width, height, 0, flags) == NULL ) {
+	if ( (screen = SDL_SetVideoMode(width, height, 0, flags)) == NULL ) {
 		return FALSE;
 	}
 	SDL_GL_GetAttribute( SDL_GL_STENCIL_SIZE, &size);
 
-	ReSizeGLScene(width, height);						// Set Up Our Perspective GL Screen
+	ReSizeGLScene(width, height); // Set Up Our Perspective GL Screen
 
-	if (!InitGL())										// Initialize Our Newly Created GL Window
+	if (!InitGL()) // Initialize Our Newly Created GL Window
 	{
-		KillGLWindow();									// Reset The Display
-		return FALSE;									// Return FALSE
+	  KillGLWindow();  // Reset The Display
+	  return FALSE;
 	}
 
-	return TRUE;										// Success
+	return TRUE;
 }
 
Index: /orxonox/branches/osX/importer/windowHandler.h
===================================================================
--- /orxonox/branches/osX/importer/windowHandler.h	(revision 2976)
+++ /orxonox/branches/osX/importer/windowHandler.h	(revision 2977)
@@ -14,4 +14,7 @@
 #include <math.h>
 
+#ifdef __WIN32__
+#include <windows.h>
+#endif /* __WIN32__ */
 
 #define TRUE 1
@@ -26,4 +29,5 @@
     GLvoid KillGLWindow(GLvoid);
     BOOL CreateGLWindow(char* title, int width, int height, int bits, BOOL fullscreenflag);
+    SDL_Surface* screen;
   private:
     int InitGL(GLvoid);
Index: /orxonox/branches/osX/src/object.cc
===================================================================
--- /orxonox/branches/osX/src/object.cc	(revision 2976)
+++ /orxonox/branches/osX/src/object.cc	(revision 2977)
@@ -297,8 +297,8 @@
     }
   objFileName = fileName;
-  char Buffer[500];
+  char Buffer[10000];
   while(!OBJ_FILE->eof())
     {
-      OBJ_FILE->getline(Buffer, 500);
+      OBJ_FILE->getline(Buffer, 10000);
       if (verbose >=4)
 	printf ("Read input line: %s\n",Buffer);
@@ -379,7 +379,7 @@
     {
       currentGroup->vertices->finalizeArray();
-      glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray());
+      //      glVertexPointer(3, GL_FLOAT, 0, currentGroup->vertices->getArray());
       currentGroup->normals->finalizeArray();
-      glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray());
+      //      glNormalPointer(GL_FLOAT, 0, currentGroup->normals->getArray());
       currentGroup->vTexture->finalizeArray();
     }
@@ -387,10 +387,29 @@
   readingVertices = false;
   currentGroup->faceCount++;
-  char subbuffer1[20];
-  char subbuffer2[20];
-  char subbuffer3[20];
-  char subbuffer4[20] ="";
-  sscanf (faceString, "%s %s %s %s", subbuffer1, subbuffer2, subbuffer3, subbuffer4);
-  if (!strcmp(subbuffer4, ""))
+
+  int elemCount = 0;
+  
+  FaceElement* firstElem = new FaceElement;
+  FaceElement* tmpElem = firstElem;
+
+  
+  while(strcmp (faceString, "\0"))
+    {
+      if (elemCount>0)
+	  tmpElem = tmpElem->next = new FaceElement;
+      tmpElem->next = NULL;
+
+
+      sscanf (faceString, "%s", tmpElem->value);
+      faceString += strlen(tmpElem->value);
+      if (strcmp (faceString, "\0"))
+	faceString++;
+      elemCount++;
+
+
+    }
+  
+  
+  if (elemCount == 3)
     {
       if (currentGroup->faceMode != 3)
@@ -403,11 +422,8 @@
       currentGroup->faceMode = 3;
       if (verbose >=3)
-	printf ("found triag: %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3);
-      addGLElement(subbuffer1);
-      addGLElement(subbuffer2);
-      addGLElement(subbuffer3);
-      return true;
-    }
-  else
+	printf ("found triag.\n");
+    }
+  
+  else if (elemCount == 4)
     {
       if (currentGroup->faceMode != 4)
@@ -419,11 +435,25 @@
       currentGroup->faceMode = 4;
       if (verbose >=3 )
-	printf ("found quad: %s, %s, %s, %s\n", subbuffer1, subbuffer2, subbuffer3, subbuffer4);
-      addGLElement(subbuffer1);
-      addGLElement(subbuffer2);
-      addGLElement(subbuffer3);
-      addGLElement(subbuffer4);
-      return true;
-    }
+	printf ("found quad.\n");
+    }
+  
+  else if (elemCount > 4)
+    {
+      if (currentGroup->faceMode != -1)
+	glEnd();
+      glBegin(GL_POLYGON);
+      if (verbose >=3)
+	printf ("Polygon with %i faces found.", elemCount);
+      currentGroup->faceMode = elemCount;
+    }
+
+  tmpElem = firstElem;
+  while (tmpElem != NULL)
+    {
+      //      printf ("%s\n", tmpElem->value);
+      addGLElement(tmpElem->value);
+      tmpElem = tmpElem->next;
+    }
+
 }
 
@@ -444,18 +474,20 @@
 
   char* texture;
-  texture = strstr (vertex, "/");
-  texture[0] = '\0';
-  texture ++;
-  if (verbose>=3)
-    printf ("includeing texture #%i, and mapping it to group texture #%i, textureArray has %i entries.\n", atoi(texture), (atoi(texture)-1 - currentGroup->firstVertexTexture)*3, currentGroup->vTexture->getCount());
-  glTexCoord2fv(currentGroup->vTexture->getArray()+(atoi(texture)-1 - currentGroup->firstVertexTexture)*2);
-
-  char* normal;
-  if ((normal = strstr (texture, "/")) !=NULL)
-    {
-      normal[0] = '\0';
-      normal ++;
-      //glArrayElement(atoi(vertex)-1);
-      glNormal3fv(currentGroup->normals->getArray() +(atoi(normal)-1 - currentGroup->firstNormal)*3);
+  if ((texture = strstr (vertex, "/")) != NULL)
+    {
+      texture[0] = '\0';
+      texture ++;
+      if (verbose>=3)
+	printf ("includeing texture #%i, and mapping it to group texture #%i, textureArray has %i entries.\n", atoi(texture), (atoi(texture)-1 - currentGroup->firstVertexTexture)*3, currentGroup->vTexture->getCount());
+      glTexCoord2fv(currentGroup->vTexture->getArray()+(atoi(texture)-1 - currentGroup->firstVertexTexture)*2);
+
+      char* normal;
+      if ((normal = strstr (texture, "/")) !=NULL)
+	{
+	  normal[0] = '\0';
+	  normal ++;
+	  //glArrayElement(atoi(vertex)-1);
+	  glNormal3fv(currentGroup->normals->getArray() +(atoi(normal)-1 - currentGroup->firstNormal)*3);
+	}
     }
   if (verbose>=3)
Index: /orxonox/branches/osX/src/object.h
===================================================================
--- /orxonox/branches/osX/src/object.h	(revision 2976)
+++ /orxonox/branches/osX/src/object.h	(revision 2977)
@@ -18,4 +18,10 @@
 extern int verbose; //!< fill be removed and added again as a verbose-class
 
+
+struct FaceElement
+{
+  char value[20];
+  FaceElement* next;
+};
 
 //! Class that handles 3D-Objects. it can also read them in and display them.
Index: /orxonox/branches/osX/src/player.cc
===================================================================
--- /orxonox/branches/osX/src/player.cc	(revision 2976)
+++ /orxonox/branches/osX/src/player.cc	(revision 2977)
@@ -26,5 +26,5 @@
 {
 
-  obj = new Object ("reaphigh.obj");
+  obj = new Object ("reaplow.obj");
   /*
   objectList = glGenLists(1);
