shaobohou 128 Report post Posted May 26, 2005 I have recently implemented something from a paper where statistical models are learned from motion data. Part of the information used for learning is information with respect to up direction which essentially taken as the third row of a rotation matrix (the z value for each axis). What I'd like to know is that given that the values for this row is know, how can I generate a orientation matrix/quaternion that satisfies this constraint, obviously there are infinite number of possible orientations available but I don't really care which specific one I end up with. The paper don't really elaborate on the matter and makes no references to any other paper. thanks for any help. 0 Share this post Link to post Share on other sites
jyk 2094 Report post Posted May 26, 2005 I can't address the statistics aspect, but if you're talking about building an orthogonal matrix from a single vector, that's pretty easy. If that's what you need I can give you the algorithm or post some code (if no one else does first).[Edit: never mind.] 0 Share this post Link to post Share on other sites
John Schultz 811 Report post Posted May 26, 2005 Dot the desired up vector with the world up vector. If it's 1.0, use the identity matrix, otherwise, cross the two vectors to create a perp vector and normalize. Cross this new vector with the desired up vector. These three vectors can now be used to create a rotation matrix.EDIT: If you already have this matrix R (from your later post, below), the above steps are redundant.[Edited by - John Schultz on May 27, 2005 2:12:59 PM] 0 Share this post Link to post Share on other sites
shaobohou 128 Report post Posted May 27, 2005 I am not sure that is what I am after, here is the description from the paper, what I want to do is sort of reverse the process."Vertical orientation: We include a feature that measures the global orientation of the character with respect to the up direction, (along the Z-axis) defined as follows. Let R be a rotation matrix that maps a vector in the character s local coordinate frame to the world coordinate frame. We take the three canonical basis vectors in the local coordinate frame, rotate them by this matrix, and take their Z-components, to get an estimate to the degree that the character is leaning forward and to the side. This reduces to simply taking the third row of R."thanks 0 Share this post Link to post Share on other sites
jyk 2094 Report post Posted May 27, 2005 So you want an orthonormal basis derived from the z components only? Since the transpose of an orthogonal matrix is itself orthogonal, it seems that you could simply use John's method and apply it to the rows of your matrix rather than the columns... 0 Share this post Link to post Share on other sites
John Schultz 811 Report post Posted May 27, 2005 Quote:Original post by shaobohouI am not sure that is what I am after, here is the description from the paper, what I want to do is sort of reverse the process."Vertical orientation: We include a feature that measures the global orientation of the character with respect to the up direction, (along the Z-axis) defined as follows. Let R be a rotation matrix that maps a vector in the character s local coordinate frame to the world coordinate frame. We take the three canonical basis vectors in the local coordinate frame, rotate them by this matrix, and take their Z-components, to get an estimate to the degree that the character is leaning forward and to the side. This reduces to simply taking the third row of R."thanksThe "canonical basis vectors in the local coordinate frame" is equivalent to the identity matrix, thus it's clear that you only need to look at R, and extract the geometric basis vector for UP (in this case, a column oriented matrix where Z is up).Thus, just extract the Z row of R, and move on to the next step of the algorithm. To determine lean angle, dot world UP with the extracted UP vector. Since the world UP will contain one non-zero value, you can look at just one component, the Z value from the Z row.Perhaps post a link to the paper. 0 Share this post Link to post Share on other sites
shaobohou 128 Report post Posted May 28, 2005 http://grail.cs.washington.edu/projects/styleik/styleik.pdf 0 Share this post Link to post Share on other sites