61 #include "OSDTransformNode.hh" 76 void OSDTransformNode::enterOSD( GLState &_state,
const DrawModes::DrawMode &_drawMode )
78 _state.push_modelview_matrix();
80 int left, bottom, width, height;
81 _state.get_viewport( left, bottom, width, height );
83 double aspect = _state.aspect();
85 _state.push_projection_matrix();
86 _state.reset_projection();
88 _state.perspective( 45.0, aspect, 0.8, 20.0 );
90 _state.push_modelview_matrix();
91 _state.reset_modelview();
93 double posX = left + center_[0] * width;
94 double posY = bottom + center_[1] * height;
98 _state.pop_modelview_matrix();
100 GLMatrixd modelview = _state.modelview();
102 modelview(0,3) = 0.0;
103 modelview(1,3) = 0.0;
104 modelview(2,3) = 0.0;
106 _state.set_modelview( modelview );
107 _state.
translate( pos[0], pos[1], pos[2], MULT_FROM_LEFT );
114 void OSDTransformNode::leaveOSD( GLState &_state,
const DrawModes::DrawMode &_drawMode )
116 _state.pop_projection_matrix();
117 _state.pop_modelview_matrix();
void translate(Scalar _x, Scalar _y, Scalar _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply self with translation matrix (x,y,z)
GLMatrixT< double > GLMatrixd
typedef
Namespace providing different geometric functions concerning angles.