Open kaufManu opened 4 years ago
I can't really comment on this. I got the code doing what I needed it to do. Although this is a very simple thing to do, there was very little information I could find that wasn't either contradictory, or written in simple english. The internet is full of trash. The book I used as a reference for this was incomplete.
As it stands, there are a few issues in the lib that need correction. Unfortunately I'm both: not in a position to be able to resolve this (time wise / job wise), and do not directly use this library anymore. There have been some PRs but none has been complete and only add further inconsistencies before the devs abandon their PRs. Despite this library being used in a number of places (prideout used it in a demo that made HN front page), no one is forth-coming with any help.
If you think you can resolve this and or any other issue, please feel free to do so. Simply documenting the issues (be they bugs or just lack of clarity) through the issue tracker is great, there's no expectation of an issue creator to fix them. Just understand I'm not in a position to do so myself.
I would hate to see this lib disappear. But it deserves some love from someone who has better domain knowledge than I.
On Wed, Sep 2, 2020 at 1:57 AM kaufManu notifications@github.com wrote:
I'm not sure if this is an issue or not, but the following code snippet just confused me a lot.
I am creating a rotation matrix that rotates around z by 90 degrees. This means, when we rotate the x vector [1.0, 0.0, 0.0] by this rotation I would expect to get the y vector [0.0, 1.0, 0.0]. As you can see from the code snippet below however, using pyrr matrices and vectors, we obtain the negative y vector, i.e. [0.0, -1.0, 0.0]. This is because pyrr is applying the vector v from the left. So when converting a numpy rotation matrix to pyrr.Matrix33 we should pass in its transpose to get the same behavior.
May be this is what the documentation means by saying matrices are row-major. But in any case, this is extremely confusing because when printing the pyrr rotation matrix m the printout is exactly the same as when printing the numpy rotation matrix rot.
import cv2import numpy as npfrom pyrr import Matrix33from pyrr.matrix33 import apply_to_vector aa = np.array([0.0, 0.0, np.pi/2])rot = cv2.Rodrigues(aa)[0] v = np.array([1.0, 0.0, 0.0])[:, np.newaxis]v_prime = np.matmul(rot, v)print('rotation matrix', rot)print('v_prime', v_prime) m = Matrix33(rot)v_prime_pyrr = apply_to_vector(m, v.squeeze())print('rotation matrix', m)print('v_prime_pyrr', v_prime_pyrr)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adamlwgriffiths/Pyrr/issues/101, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJOQ5FTMG35CRWGWJW2BITSDUKWNANCNFSM4QR4NAYA .
I should also clarify. The main use case was OpenGL. Hence the matrices are transposed.
On Wed, Sep 2, 2020 at 10:40 AM Adam Griffiths adam.lw.griffiths@gmail.com wrote:
I can't really comment on this. I got the code doing what I needed it to do. Although this is a very simple thing to do, there was very little information I could find that wasn't either contradictory, or written in simple english. The internet is full of trash. The book I used as a reference for this was incomplete.
As it stands, there are a few issues in the lib that need correction. Unfortunately I'm both: not in a position to be able to resolve this (time wise / job wise), and do not directly use this library anymore. There have been some PRs but none has been complete and only add further inconsistencies before the devs abandon their PRs. Despite this library being used in a number of places (prideout used it in a demo that made HN front page), no one is forth-coming with any help.
If you think you can resolve this and or any other issue, please feel free to do so. Simply documenting the issues (be they bugs or just lack of clarity) through the issue tracker is great, there's no expectation of an issue creator to fix them. Just understand I'm not in a position to do so myself.
I would hate to see this lib disappear. But it deserves some love from someone who has better domain knowledge than I.
On Wed, Sep 2, 2020 at 1:57 AM kaufManu notifications@github.com wrote:
I'm not sure if this is an issue or not, but the following code snippet just confused me a lot.
I am creating a rotation matrix that rotates around z by 90 degrees. This means, when we rotate the x vector [1.0, 0.0, 0.0] by this rotation I would expect to get the y vector [0.0, 1.0, 0.0]. As you can see from the code snippet below however, using pyrr matrices and vectors, we obtain the negative y vector, i.e. [0.0, -1.0, 0.0]. This is because pyrr is applying the vector v from the left. So when converting a numpy rotation matrix to pyrr.Matrix33 we should pass in its transpose to get the same behavior.
May be this is what the documentation means by saying matrices are row-major. But in any case, this is extremely confusing because when printing the pyrr rotation matrix m the printout is exactly the same as when printing the numpy rotation matrix rot.
import cv2import numpy as npfrom pyrr import Matrix33from pyrr.matrix33 import apply_to_vector aa = np.array([0.0, 0.0, np.pi/2])rot = cv2.Rodrigues(aa)[0] v = np.array([1.0, 0.0, 0.0])[:, np.newaxis]v_prime = np.matmul(rot, v)print('rotation matrix', rot)print('v_prime', v_prime) m = Matrix33(rot)v_prime_pyrr = apply_to_vector(m, v.squeeze())print('rotation matrix', m)print('v_prime_pyrr', v_prime_pyrr)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adamlwgriffiths/Pyrr/issues/101, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJOQ5FTMG35CRWGWJW2BITSDUKWNANCNFSM4QR4NAYA .
I'm not sure if this is an issue or not, but the following code snippet just confused me a lot.
I am creating a rotation matrix that rotates around z by 90 degrees. This means, when we rotate the x vector
[1.0, 0.0, 0.0]
by this rotation I would expect to get the y vector[0.0, 1.0, 0.0]
. As you can see from the code snippet below however, using pyrr matrices and vectors, we obtain the negative y vector, i.e.[0.0, -1.0, 0.0]
. This is because pyrr is applying the vectorv
from the left. So when converting a numpy rotation matrix topyrr.Matrix33
we should pass in its transpose to get the same behavior.May be this is what the documentation means by saying matrices are row-major. But in any case, this is extremely confusing because when printing the pyrr rotation matrix
m
the printout is exactly the same as when printing the numpy rotation matrixrot
.