Page 1 of 1

Define user coordinate system

Posted: Thu Nov 21, 2013 8:34 am
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.

Re: Define user coordinate system

Posted: Thu Nov 21, 2013 9:38 am
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)

Re: Define user coordinate system

Posted: Thu Nov 21, 2013 11:47 am
by Ingsayyad
Where can I find align camera.

Re: Define user coordinate system

Posted: Thu Nov 21, 2013 3:09 pm
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.