controller position
There is getPos() ut can't found getRot()
first on BB can't found email to You so create this :) sorry :) HELP :)
Comments (6)
-
repo owner -
Thanks for creating ViveP5! As you suggested, would be great if you would expose Controller’s matrix for the purpose of being able to extract controller orientation.
Edit - So I did not need to bug you, I learned just enough following instructions https://github.com/processing/processing-library-template to allow me to import a clone of your repo., make matrix public and recompile. Cool - I see matrix can be used to transform coordinates from controller to world - exactly what I needed. Interesting that for DIY coordinate transforms, PMatrix3D does not implement a multiply method.
-
repo owner Hi Ron, I’ve rebuilt the library with the controller position matrix exposed and added a GetControllerMatrix function. If you make any changes to the library that you think would be valuable to add let me know or pull request your code.
-
repo owner - changed status to resolved
Exposed Controller position matrix.
-
Hello James, Thanks for making the change. It might a while before know what I am doing with git pull/push requests. I was wondering if your intention with get method was to protect Controller’s ‘matrix’ from being modified by caller versus my hack approach making matrix public? If so, read on…
I see PMatrix3D implements a method ’get' to make a copy of the matrix, i.e. return matrix.get(); versus handing off a reference to matrix with return matrix; (if I am using the right terminology).
For example with return matrix;
PMatrix3D m = myController.getControllerMatrix(); // m is same object as myController’s matrix
m.scale(2); // just modified myController’s matrix
Also, I see PMatrix3D implements print() method – which is handy.
Ron
-
Do you know how i could get the “looking at vector” and yaw/pitch/roll of a controller as PVectors?
To be honest, i did not yet understood the “structure” of the matrices. The documentation of PMatrix3D in processings docs are not helping me.
- Log in to comment
Hi - sorry for the late reply.
The rotation matrix is contained in the controller class in the PMatrix3D "matrix" object.
It is possible for me to either expose this object, or I can add a "getRot()" function, but it would return a matrix. It's worth noting that the "matrix" object also contains position.