Sign in to follow this  
shaobohou

Up orientation calculation

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Quote:
Original post by shaobohou
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


The "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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this