Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotation matrix : how does it work for flip? #23

Open
VLEFF opened this issue Jun 24, 2018 · 5 comments
Open

rotation matrix : how does it work for flip? #23

VLEFF opened this issue Jun 24, 2018 · 5 comments

Comments

@VLEFF
Copy link

VLEFF commented Jun 24, 2018

Hi,

I just realised that both flip and rotation informations are in the rotation matrix (_r), but how does it work exactly?
How can I say when it is rotation or when it is flip? How can I know that there is a rotation and a flip at the same time?
Rotation and flip are two differents thing right? So I don't get why there is not two different attributes?

Exemple (based on datas collected from .vox file):

Rotation Z 90° :
0 -1 0
1 0 0
0 0 1

flip Y :
1 0 0
0 -1 0
0 0 1

Rotation Z 90° + flip Y :
0 -1 0
-1 0 0
0 0 1

So, from the last one, how can I extract the two first to apply them both?

@VLEFF
Copy link
Author

VLEFF commented Jul 31, 2018

My workaround for the moment :
I have extracted all the possible cases and made some kind of dictionnary, but you know... it's ugly =(

@ephtracy do you have the answer?

@ephtracy
Copy link
Owner

ephtracy commented Jul 31, 2018

one pose can be achieved by different transform sequences.
For example, in your case, the final pose can be achieved by:
1.Rot Z 90 + Flip Y, or
2. Rot Z -90 + Flip X
One workaround: cross product first and second rows, and check the sign with the third row to figure out whether it has been flipped.

@hnim
Copy link

hnim commented Mar 19, 2023

hi, how can I parse rotation and scale (flip) from _r attribute?

@TheStrokeForge
Copy link

Hi there! Can someone please help me in separating the Rotation and flip values from each other? Thanks!

@TheStrokeForge
Copy link

one pose can be achieved by different transform sequences. For example, in your case, the final pose can be achieved by: 1.Rot Z 90 + Flip Y, or 2. Rot Z -90 + Flip X One workaround: cross product first and second rows, and check the sign with the third row to figure out whether it has been flipped.

I did this, but how do I figure out in which axis is the flip applied? And then How do I separate it? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants