Changeset 3746 in orxonox.OLD for orxonox/branches/levelloader/src/lib/graphics/importer/framework.cc
- Timestamp:
- Apr 7, 2005, 3:54:49 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/lib/graphics/importer/framework.cc
r3499 r3746 17 17 18 18 #include "vector.h" 19 20 #include "primitive_model.h" 21 19 22 20 23 int verbose; … … 76 79 obj = new OBJModel(argv[1]); 77 80 else 78 { 79 // This is an example, of how it is possible, to create a new Model, and adding some vertex-information. 80 // This also packs everything into a DisplayList, and can be handled exactly as any other model. 81 // This is an example of a cube with Texture-Coordinates, but without explicite Vertex-Normals. (they are soft-created). 82 /* 83 obj = (OBJModel*) new Model(); 84 obj->setName("CUBE"); 85 obj->addVertex (-0.5, -0.5, 0.5); 86 obj->addVertex (0.5, -0.5, 0.5); 87 obj->addVertex (-0.5, 0.5, 0.5); 88 obj->addVertex (0.5, 0.5, 0.5); 89 obj->addVertex (-0.5, 0.5, -0.5); 90 obj->addVertex (0.5, 0.5, -0.5); 91 obj->addVertex (-0.5, -0.5, -0.5); 92 obj->addVertex (0.5, -0.5, -0.5); 93 94 obj->addVertexTexture (0.0, 0.0); 95 obj->addVertexTexture (1.0, 0.0); 96 obj->addVertexTexture (0.0, 1.0); 97 obj->addVertexTexture (1.0, 1.0); 98 obj->addVertexTexture (0.0, 2.0); 99 obj->addVertexTexture (1.0, 2.0); 100 obj->addVertexTexture (0.0, 3.0); 101 obj->addVertexTexture (1.0, 3.0); 102 obj->addVertexTexture (0.0, 4.0); 103 obj->addVertexTexture (1.0, 4.0); 104 obj->addVertexTexture (2.0, 0.0); 105 obj->addVertexTexture (2.0, 1.0); 106 obj->addVertexTexture (-1.0, 0.0); 107 obj->addVertexTexture (-1.0, 1.0); 108 109 obj->addFace ("1 2 4 3"); 110 obj->addFace ("3 4 6 5"); 111 obj->addFace ("5 6 8 7"); 112 obj->addFace ("7 8 2 1"); 113 obj->addFace ("2 8 6 4"); 114 obj->addFace ("7 1 3 5"); 115 obj->finalize(); 116 */ 117 obj = (OBJModel*) new Model(CYLINDER); 118 } 81 obj = new PrimitiveModel(SPHERE); 82 119 83 M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0); 120 84 rotAxis = Vector (0.0,1.0,0.0); … … 166 130 switch (event.type) { 167 131 case SDL_MOUSEMOTION: 168 PRINTF( 3)("Mouse motion about %d,%d Pixels to (%d,%d).\n",132 PRINTF(4)("Mouse motion about %d,%d Pixels to (%d,%d).\n", 169 133 event.motion.xrel, event.motion.yrel, 170 134 event.motion.x, event.motion.y); … … 205 169 if (event.button.button == 4) 206 170 { 207 PRINTF( 0)("MouseWheel up\n");171 PRINTF(4)("MouseWheel up\n"); 208 172 zoomTo *= .5; 209 173 } 210 174 else if (event.button.button == 5) 211 175 { 212 PRINTF( 2)("MouseWheel down\n");176 PRINTF(4)("MouseWheel down\n"); 213 177 zoomTo *= 2.0; 214 178 } … … 240 204 else 241 205 { 242 PRINTF( 2)("MouseButton %d released at (%d,%d).\n",206 PRINTF(4)("MouseButton %d released at (%d,%d).\n", 243 207 event.button.button, event.button.x, event.button.y); 244 208 }
Note: See TracChangeset
for help on using the changeset viewer.