![]() Registered Member ![]()
|
I currently have code which uses a starting point (x, y, z) and a vector from that point that should represent the x-axis of the new coordinate system. Currently the code goes through and figures out Euler angles in order to use prerotate and AngleAxisd to build the rotation portion of the transform.
It seems to me that there should be some method of assembling the transform without going through Euler angles. So when the point from the "World" coordinates is transferred into the objects coordinates, the vector given should be the new x-axis. The y, and z axis are not important, for the sake of putting them somewhere we have been aligning the local z-axis in the world xz (zdown) plane and then making the y-axis orthogonal to that plane. The result is that the x position in the new coordinate system is the distance the point is from the starting point (right angle distance) and the sqrt(y^2 + z^2) is the shortest distance (again right angle) from the x-axis of the new system. Those two distances are the important numbers. Let me know if this just doesn't make any sense. Also it appears our world axis might be changing soon, we've been working in a right handed north-east-down (x-y-z) system, we are going to be moving to a left handed system, which will result in positive z being up rather than down. So I need to get the new solution to pass our existing tests, as well as understand it well enough to reconfigure it for the new system. Thanks |
![]() Registered Member ![]()
|
So this is what i'm currently doing that does the job:
phi, theta, and psi are the output Euler angles
Then...
What I think I would like to do is something like this:
The rotationMatrix would become the linear portion of an Affine Transform Matrix. Obviously my matrix method is wrong I just don't understand it enough to figure out how and why? Any help? Is this even slightly doable? |
![]() Registered Member ![]()
|
What about using Eigen::Affine3d ? It's one of the most useful thing in Eigen when treating affine transformations (it's included in the Geometry header
For example
there are many other methods to do this, but this is simple to read and understand in my opinion. |
![]() Registered Member ![]()
|
The problem I'm trying to address is avoiding the computation of theta, phi, and psi.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]