Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 56ca05496a248d1f9b7f2e811381517a3f4bcf90 @ChrisLundquist committed Jun 14, 2011
Showing with 1,233 additions and 0 deletions.
  1. +45 −0 Driver.cpp
  2. +708 −0 Md2.cpp
  3. +34 −0 Model.cpp
  4. +35 −0 Model.h
  5. +98 −0 Obj.cpp
  6. +23 −0 Obj.h
  7. +158 −0 Ply.cpp
  8. +12 −0 Ply.h
  9. +4 −0 README
  10. +116 −0 Raw.cpp
@@ -0,0 +1,45 @@
+#ifdef _WIN32
+#include <windows.h>
+#endif
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include "Model.h"
+#include "Obj.h"
+
+void usage(){
+ std::cout << "Please specify paths to models" << std::endl;
+}
+
+void draw(Model::Model* model){
+ glEnable(GL_TEXTURE_2D);
+ // glBindTexture(GL_TEXTURE_2D, texturen[0]);
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glEnableClientState(GL_NORMAL_ARRAY);
+ glNormalPointer(GL_FLOAT, 0, model->normals);
+
+ glTexCoordPointer(2,GL_FLOAT,0, model->textures );
+ glVertexPointer(3,GL_FLOAT, 0,model->triangles);
+ glDrawArrays(GL_TRIANGLES, 0, model->totalConnectedTriangles);
+
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ glDisable(GL_TEXTURE_2D);
+}
+
+void main(int argc, char** argv){
+ /*
+ //TODO, parse argv
+ if(argc < 1){
+ usage();
+ return;
+ }
+ */
+
+ Model::Model* m = new Model::Obj();
+ m->load("cube.obj");
+
+}
Oops, something went wrong.

0 comments on commit 56ca054

Please sign in to comment.