void Camera::GetProjectionMatrix( M3DMatrix44f m ) { // Transform the frustum with the camera frame so that it // is updated with the current position _viewFrustum.Transform( _frame ); m3dCopyMatrix44( m, _viewFrustum.GetProjectionMatrix() ); }
void Selection::set_config( M3DVector3f *_pts, int _nr, M3DVector2f _left_bottom, M3DVector2f _right_top, M3DMatrix44f _model_view, M3DMatrix44f _proj, int _viewport[] ) { pts = _pts; nr = _nr; m3dCopyVector2(left_bottom, _left_bottom); m3dCopyVector2(right_top, _right_top); m3dCopyMatrix44(model_view, _model_view); m3dCopyMatrix44(proj, _proj); memcpy(viewport, _viewport, sizeof(int) * 4); /*** 计算被选中的index ***/ cal_selected_index(); }
void Transform::Scale( float xScale, float yScale, float zScale ) { M3DMatrix44f _scmatrix; m3dScaleMatrix44( _scmatrix, xScale, yScale, zScale ); M3DMatrix44f _source; m3dCopyMatrix44(_source, _matrix); m3dMatrixMultiply44(_matrix, _source, _scmatrix); }
void Transform::Rotate( float angle, float x, float y, float z ) { M3DMatrix44f _rotmatrix; m3dRotationMatrix44( _rotmatrix, angle, x, y, z ); M3DMatrix44f _source; m3dCopyMatrix44(_source, _matrix); m3dMatrixMultiply44(_matrix, _source, _rotmatrix); }
void Transform::GetMatrix( M3DMatrix44f m ) const { m3dCopyMatrix44( m, _matrix ); }
void Transform::SetMatrix( M3DMatrix44f m ) { m3dCopyMatrix44( _matrix, m ); }
/** \brief Transform Node is initialized with a matrix */ Transform::Transform(const M3DMatrix44f& m) : CompositeNode() { m3dCopyMatrix44(_matrix, m); }