- Timestamp:
- 05/21/08 02:53:16 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2689 r2693 2519 2519 } 2520 2520 2521 } 2521 2522 2523 Vector3 QtGlRendererWidget::Unproject(int x, int y) 2524 { 2525 // swap y coordinate 2526 //y = GetHeight() - y; 2527 2528 // HACK: should come from camera! 2529 double projection[16]; 2530 glGetDoublev(GL_PROJECTION_MATRIX, projection); 2531 double modelview[16]; 2532 glGetDoublev(GL_MODELVIEW_MATRIX, modelview); 2533 2534 const int viewport[4] = {0,0, GetWidth(), GetHeight()}; 2535 2536 float z; 2537 glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z); 2538 2539 RenderScene(); 2540 2541 GLdouble rx, ry, rz; 2542 gluUnProject(x, y, z, modelview, projection, viewport, &rx, &ry, &rz); 2543 2544 return Vector3(rx, ry, rz); 2545 } 2546 2547 2548 } -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r2686 r2693 313 313 void WriteViewCellInfos(); 314 314 315 /** Unproject x/y screen coordinates. 316 */ 317 Vector3 Unproject(int x, int y); 315 318 316 319 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface05.vcproj
r2681 r2693 225 225 </File> 226 226 <File 227 RelativePath=".\ObjectPlacer.h" 228 > 229 </File> 230 <File 227 231 RelativePath="QtGlRenderer.cpp" 228 232 > … … 248 252 <File 249 253 RelativePath="LogWriter.h" 254 > 255 </File> 256 <File 257 RelativePath=".\ObjectPlacer.cpp" 250 258 > 251 259 </File>
Note: See TracChangeset
for help on using the changeset viewer.