Projects 3D models into a GL context given a camera projection matrix. More...
#include <vgui_camera.h>
Public Member Functions | |
vgui_camera () | |
Constructor - create a camera with a default projection matrix. | |
vgui_camera (vnl_matrix_fixed< double, 3, 4 > const &P) | |
Constructor - create a camera with the given projection matrix. | |
void | set_pmatrix (vnl_matrix_fixed< double, 3, 4 > const &m) |
Set the projection matrix to the given matrix. | |
vnl_matrix_fixed< double, 3, 4 > | get_glprojmatrix (const int imagesizex=720, const int imagesizey=576) const |
Plug this matrix into a vgui_loader_tableau. | |
Protected Attributes | |
vnl_matrix_fixed< double, 3, 4 > | pmatrix |
The projection matrix. |
Projects 3D models into a GL context given a camera projection matrix.
vgui_camera is a utility class which allows 3D models to projected into a GL context given a known camera projection matrix. Note comments in code about clipping planes which is really rather important if you care about such things. Use the class in conjunction with a vgui_load (if you dare), or a vgui_mult to change the GL_PROJECTION_MATRIX appropriately.
Definition at line 29 of file vgui_camera.h.
vgui_camera::vgui_camera | ( | ) | [inline] |
Constructor - create a camera with a default projection matrix.
Definition at line 33 of file vgui_camera.h.
vgui_camera::vgui_camera | ( | vnl_matrix_fixed< double, 3, 4 > const & | P | ) | [inline] |
Constructor - create a camera with the given projection matrix.
Definition at line 36 of file vgui_camera.h.
vnl_matrix_fixed< double, 3, 4 > vgui_camera::get_glprojmatrix | ( | const int | imagesizex = 720 , |
const int | imagesizey = 576 |
||
) | const |
Plug this matrix into a vgui_loader_tableau.
Note: this will return a GL_PROJECTION_MATRIX with the assumption that you have a Euclidean reconstruction. The result is that the front and back clipping planes will be PARALLEL (note: not projective frame!) to the image plane.
Definition at line 21 of file vgui_camera.cxx.
void vgui_camera::set_pmatrix | ( | vnl_matrix_fixed< double, 3, 4 > const & | m | ) | [inline] |
Set the projection matrix to the given matrix.
Definition at line 39 of file vgui_camera.h.
vnl_matrix_fixed<double,3,4> vgui_camera::pmatrix [protected] |
The projection matrix.
Definition at line 51 of file vgui_camera.h.