This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Homogeneous unclear

Tags: None
(comma "," separated)
arennuit
Registered Member
Posts
28
Karma
0

Homogeneous unclear

Thu Feb 25, 2016 6:19 pm
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.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Homogeneous unclear

Thu Feb 25, 2016 8:24 pm
It's like virtually adding a 4th coordinate equals to 1.
arennuit
Registered Member
Posts
28
Karma
0

Re: Homogeneous unclear

Thu Feb 25, 2016 9:36 pm
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!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Homogeneous unclear

Fri Feb 26, 2016 10:00 pm
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.
arennuit
Registered Member
Posts
28
Karma
0

Re: Homogeneous unclear

Sun Feb 28, 2016 5:46 pm
This is now clear, thanks for your help!


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft