56 #include "TransformNode.hh" 72 center_(0.0, 0.0, 0.0),
73 applyTransformation_(true),
75 isPerSkeletonObject_(false),
77 imageDimensions_(
ACG::
Vec2i(-1,-1) ),
102 translation_ =
Vec3d(0.0, 0.0, 0.0);
149 quaternion_ *=
Quaterniond(_axis, _angle/180.0*M_PI);
152 inverse_rotation_matrix_ = rotation_matrix_;
168 inverse_rotation_matrix_ = rotation_matrix_;
181 scale_matrix_.
scale(_s);
182 inverse_scale_matrix_ = scale_matrix_;
183 inverse_scale_matrix_.
invert();
195 inverse_scale_matrix_ = scale_matrix_;
196 inverse_scale_matrix_.
invert();
212 matrix_ *= rotation_matrix_;
213 matrix_ *= scale_matrix_;
218 inverse_matrix_ = matrix_;
274 if ( applyTransformation_ )
280 if(isPerSkeletonObject_)
281 perSkeletonMode(_state);
366 perSkeletonMode(
GLState& _state)
381 if (width == 0 || height == 0)
387 _state.
ortho(-(GLdouble)width/2.0, (GLdouble)width/2.0, -(GLdouble)height/2.0, (GLdouble)height/2.0, 0.01, 20.0);
394 Vec3d(0.0,-1.0,0.0));
396 _state.
scale(scaleFactor2D_, scaleFactor2D_, 1.0);
399 if (imageDimensions_[0] != -1)
400 _state.
translate(-0.5*(imageDimensions_[0]-1), -0.5*(imageDimensions_[1]-1), 0);
402 _state.
translate(offset_[0], offset_[1], 0);
void reset_modelview()
reset modelview matrix (load identity)
void identity()
identity rotation
void pop_modelview_matrix()
pop modelview matrix
int viewport_width() const
get viewport width
Namespace providing different geometric functions concerning angles.
void push_projection_matrix()
push projection matrix
void transpose()
transpose matrix
void translate(Scalar _x, Scalar _y, Scalar _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply self with translation matrix (x,y,z)
Matrix rotation_matrix() const
cast to rotation matrix
void identity()
setup an identity matrix
void scale(double _s)
scale by (_s, _s, _s)
VectorT< T, 3 > transform_point(const VectorT< T, 3 > &_v) const
transform point (x',y',z',1) = M * (x,y,z,1)
void mult_matrix(const GLMatrixd &_m, const GLMatrixd &_inv_m, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply by a given transformation matrix
void reset_projection()
reset projection matrix (load identity)
bool invert()
matrix inversion (returns true on success)
void push_modelview_matrix()
push modelview matrix
void set_modelview(const GLMatrixd &_m)
set modelview
void ortho(double _left, double _right, double _bottom, double _top, double _near_plane, double _far_plane)
orthographic projection
void scale(Scalar _x, Scalar _y, Scalar _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply self with scaling matrix (x,y,z)
int viewport_height() const
get viewport height
void pop_projection_matrix()
pop projection matrix
void lookAt(const Vec3d &_eye, const Vec3d &_center, const Vec3d &_up)
set camera by lookAt
auto normalize() -> decltype(*this/=std::declval< VectorT< S, DIM >>().norm())
void translate(double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
translate by (_x, _y, _z)
VectorT< double, 3 > Vec3d