Registered Member
|
Hello!
Iam totally new to Eigen. Currently iam writing my bachelor thesis in Electronical Engeneering and i had to use Eigen I just want to create a Transform object containing translate, scale and rotate and apply it to a point. After reading some stuff in the documentation i came to this: # include <i o s t r e a m > # include <Eigen / Dense> using namespace Eigen ; int main ( ) { Vector3f P1 , P2 , t , s , r_axis ; P1 << 1 , 0 , 0 ; t << 2 , 2 , 2 ; // translation vector s << 2 , 2 , 2 ; // scale vector r_axis << 1 , 0 , 0 ; // rotate around this axis -> x Transform<float , 3 , Affine> M = Translation3f ( t ) ∗ AngleAxisf ( 0 . 5 2 , r_axis ) ∗ Scaling ( s ) ; P2 = M ∗ P1 ; return 0 ; } this gets me a big wall of errors i dont understand well. my problem is i have got only 2 days left before the end of my thesis, so i havent got the time to crawl through all the documentation. |
Moderator
|
For the record, you have to split that line (c++ issue):
|
Registered Member
|
Hi, thanks!
ich changed it to this: #include <iostream> #include "Eigen/Dense" using namespace Eigen; int main ( ) { Vector3f P1 , P2 , t , s , r_axis ; P1 << 1, 0, 0; t << 2, 2, 2; // Translationsvektor s << 2, 2, 2; // Skalierung r_axis << 1, 0, 0; // Um die Achse wird gedreht Transform<float,3,Affine> M; M.translate(t); //P2 = M ∗ P1 ; return 0 ; } this actually works but if i uncomment the line P2 = .. than it doesnt work i dont know why.. greetings. |
Moderator
|
|
Registered Member
|
even if you uncomment "//P2 = M * P1" -> "P2 = M * P1"?!
My only Problem is i cant apply the Transformation to a point! greetings Benni |
Moderator
|
yes. Please post your errors, how can we help without them?
|
Registered Member
|
Hi,
yes i know. the problem is its on german. i dont know how to switch the language of the compilermessages. Maybe you compile the code on your own? i appreciate your help! thanks so far. Benni |
Registered Member
|
When I copied-and-pasted your program, I found that the asterisk in the line
If this does not solve it, give us the error message in German (perhaps with your translation) and the version of Eigen and the compiler that you are using. |
Registered Member
|
Hello,
yes the asterisk was not rigth. I have absolutely no clue how this happend. Took me hours trying to solve my "Eigen problem". Thank you very much sir. greetings |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]