- Timestamp:
- Jul 8, 2005, 12:30:31 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/story_entities/world.cc
r4822 r4823 880 880 } 881 881 delete iterator; 882 crosshair->draw(); 882 883 883 884 glCallList (objectList); … … 885 886 ParticleEngine::getInstance()->draw(); //!< \todo should be dts like in the Trunk; 886 887 887 crosshair->draw();888 888 TextEngine::getInstance()->draw(); 889 889 LightManager::getInstance()->draw(); // must be at the end of the drawing procedure, otherwise Light cannot be handled as PNodes // -
orxonox/trunk/src/world_entities/weapons/crosshair.cc
r4818 r4823 57 57 } 58 58 59 /* 60 GLdouble z; 61 GLdouble objX, objY, objZ; 62 glReadPixels (event.x, event.y, 1, 1, GL_DEPTH_COMPONENT, GL_DOUBLE, &z); 63 64 65 if (gluUnProject(event.x, 66 event.y, 67 10, 68 GraphicsEngine::modMat, 69 GraphicsEngine::projMat, 70 GraphicsEngine::viewPort, 71 &objX, 72 &objY, 73 &objZ )) 74 PRINT(0)("screen %d %d -> obj(%f/%f/%f)\n", event.x, event.y, objX, objY, objZ); 75 else 76 PRINT(0)("shit\n"); 77 */ 59 78 } 60 79 … … 62 81 void Crosshair::draw() const 63 82 { 83 /* 64 84 const PNode* camera = State::getInstance()->getCamera(); //!< \todo MUST be different 65 85 Vector cameraPos = camera->getAbsCoor(); … … 76 96 float py = -(position2D[1]-GraphicsEngine::getInstance()->getResolutionY()/2)*.05; 77 97 78 79 80 98 glBegin(GL_TRIANGLES); 81 99 glVertex3f(cameraTargetPos.x - h.x*px - v.x*py, 82 83 100 cameraTargetPos.y - h.y*px - v.y*py, 101 cameraTargetPos.z - h.z*px - v.z*py); 84 102 85 103 glVertex3f(cameraTargetPos.x - h.x*(px+1) - v.x*py, 86 87 104 cameraTargetPos.y - h.y*(px+1) - v.y*py, 105 cameraTargetPos.z - h.z*(px+1) - v.z*py); 88 106 89 107 glVertex3f(cameraTargetPos.x - h.x*px - v.x*(py+1), 90 91 108 cameraTargetPos.y - h.y*px - v.y*(py+1), 109 cameraTargetPos.z - h.z*px - v.z*(py+1)); 92 110 93 111 glEnd(); 94 112 113 */ 114 115 GraphicsEngine::storeMatrices(); 116 117 GLdouble z; 118 GLdouble objX, objY, objZ; 119 if (gluUnProject(position2D[0], 120 GraphicsEngine::getInstance()->getResolutionY()-position2D[1], 121 .8, 122 GraphicsEngine::modMat, 123 GraphicsEngine::projMat, 124 GraphicsEngine::viewPort, 125 &objX, 126 &objY, 127 &objZ )); 128 129 glBegin(GL_TRIANGLES); 130 glColor3f(1,0,0); 131 glVertex3f(objX, objY, objZ); 132 glVertex3f(objX, objY+1, objZ); 133 glVertex3f(objX, objY, objZ+1); 134 glEnd(); 95 135 }
Note: See TracChangeset
for help on using the changeset viewer.