Define user coordinate system

Feel free to ask any question here
Post Reply
Ingsayyad
Posts: 97
Joined: Fri Oct 25, 2013 9:17 am

Define user coordinate system

Post by Ingsayyad »

Some softwares alows to define use coordinate system e.g., Autocad. One select two points ((x1,x2) or (y1,y2),) which define direction of x-axis or y-axis and by picking third point define z-axis. So, a complete transformation and rotation of this old coordiante system to new coodinate system is done.

1-I want to implement it in CC.
just an example.
% id x y z
sys1=[0,-11.281000,-18.906000,0.025000
1,-21.235001,3.426000,0.214000
2,-9.856000,-18.235001,3.946000
];

Point 0 and 1 defines x-axis and 0, 2 defines z-axis. How can I implement it in CC. I just want to rotate my point cloud to make it parallel to x-axis or y-axis.
daniel
Site Admin
Posts: 7607
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Define user coordinate system

Post by daniel »

If you want to do the math in Matlab, it's easy (but you'll have to actually make the cloud rotate, you can't rotate the camera this way):
X = P1-P0;
X = X/norm(X); //unit vector
Y = P2-P0;
Z = cross(X,Y);
Z = Z/norm(Z); //unit vector
Y = cross(Z,X); //to get an orthogonal frame

Then simply grab the resulting 3x3 matrix formed by [X Y Z] and place it in the upper left corner of the 4x4 matrix of the "Edit > Apply transformaion "tool and eventually check the 'inverse' checkbox.

A better way to do what you want in CC is to use the "Point Picking" tool:
- select the 'Select 3 points ...' small icon (on the upper right part of the 3D view)
- pick your 3 points
- save the resulting label with the small floppy icon
- close the point picking tool
- right click on the created label in the DB tree and call 'Align camera' (or the 'reverse' version depending on the way you want to look at it)
Daniel, CloudCompare admin
Ingsayyad
Posts: 97
Joined: Fri Oct 25, 2013 9:17 am

Re: Define user coordinate system

Post by Ingsayyad »

Where can I find align camera.
Attachments
CC_question.jpg
CC_question.jpg (238.12 KiB) Viewed 8520 times
daniel
Site Admin
Posts: 7607
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Define user coordinate system

Post by daniel »

Here it seems you have used the 'Point list picking' tool ;)

The "Point picking" tool is the icon right next to it, on the left. Once your triangle label is created (and saved) it will appear beneath the corresponding cloud in the DB tree.
Daniel, CloudCompare admin
Post Reply