Registered Member
|
Hello,
I need to use some sort of homogeneous data, though I am not sure I understand whether Eigen::Homogeneous fits my needs (because what it does is unclear to me). For example, if you call homogeneous() on a Eigen::Vector3f for example, what do you get? My two guesses are either: 1) you get something similar to Eigen::Vector4f. It somehow adds a forth component w to the vector which you can manipulate as x, y and z. If w needs to be an arbitrary value as 3.56, then it is possible. But in this case why Eigen::Vector3f::homogeneous() does not simply return a Vector4f? 2) you get a helper which allows you to straightforwardly multiply your Vector3 with a nx4 homogeneous matrix. In which case what is the value of the added w component, 0 or 1? Anyone has clearer ideas than I do? Regards, Antoine. |
Moderator
|
It's like virtually adding a 4th coordinate equals to 1.
|
Registered Member
|
All right, so this means it only works for points, not vectors? And the weight cannot be changed to something else but 1?
Another way to put it is to ask if I want to use a fully featured homogeneous vector3 (with the weight which can take whatever value) what I should use is a vector4 then, right? PS: thanks for your work, Eigen rocks! |
Moderator
|
No need for vectors because you can strip the matrix :
mat44.leftCols<3>() * vec3; or transform: transform3d.linear() * vec3; and if you want more control, then yes, use a Vector4. |
Registered Member
|
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft