How to get translation, rotation, reflection, scaling and shearing through Affine transformation.
vr::VRCompositor()->WaitGetPoses(m_rTrackedDevicePose, vr::k_unMaxTrackedDeviceCount, NULL, 0 ); m_rmat4DevicePose[nDevice] = ConvertSteamVRMatrixToMatrix4( m_rTrackedDevicePose[nDevice].mDeviceToAbsoluteTracking );
through this method i can get a matrix includes translation, rotation, reflection and so on,but how can i get rotation?
This matrix only contains translation and rotation. No shearing or scaling will be present. This is the location of a physical rigid body in space, so those kinds of transforms don't make sense in this context.
See the remark of the method Matrix4& Matrix4::invertAffine() in Matrices.cpp. if so,i neet to get the rotation (Vector4) to set my model in my own engine that not open sourse,how can i get it. i don't need shearing or scaling.
like this, /////////////////////////////////////////////////////////////////////////////// // compute the inverse of a 4x4 affine transformation matrix // // Affine transformations are generalizations of Euclidean transformations. // Affine transformation includes translation, rotation, reflection, scaling, // and shearing. Length and angle are NOT preserved. // M = [ R | T ] // [ --+-- ] (R denotes 3x3 rotation/scale/shear matrix) // [ 0 | 1 ] (T denotes 1x3 translation matrix) // // y = Mx -> y = Rx + T -> x = R^-1*(y - T) -> x = R^-1y - R^-1T // // [ R | T ]-1 [ R^-1 | -R^-1 * T ] // [ --+-- ] = [ -----+---------- ] // [ 0 | 1 ] [ 0 + 1 ] /////////////////////////////////////////////////////////////////////////////// Matrix4& Matrix4::invertAffine()
yaw pitch roll from rotation matrix
http://planning.cs.uiuc.edu/node103.html
On 19 April 2017 at 01:58, qywako [email protected] wrote:
like this, //////////////////////////////////////////////////////////// /////////////////// // compute the inverse of a 4x4 affine transformation matrix // // Affine transformations are generalizations of Euclidean transformations. // Affine transformation includes translation, rotation, reflection, scaling, // and shearing. Length and angle are NOT preserved. // M = [ R | T ] // [ --+-- ] (R denotes 3x3 rotation/scale/shear matrix) // [ 0 | 1 ] (T denotes 1x3 translation matrix) // // y = Mx -> y = Rx + T -> x = R^-1*(y - T) -> x = R^-1y - R^-1T // // [ R | T ]-1 [ R^-1 | -R^-1 * T ] // [ --+-- ] = [ -----+---------- ] // [ 0 | 1 ] [ 0 + 1 ] //////////////////////////////////////////////////////////// /////////////////// Matrix4& Matrix4::invertAffine()
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/openvr/issues/477#issuecomment-295030351, or mute the thread https://github.com/notifications/unsubscribe-auth/ACrxdi44J3kE8naiAy967eBIwxSaPZP6ks5rxVwmgaJpZM4NAHg7 .
It's helpful. But the order of rotation matrix OpenVR used is x,y,z or z,y,x or else?