# Help needed about Change of basis !

This topic is 3984 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi everybody, Problem is about change of basis for a given 3D model M.The coordinates of points are defined in global coordinate system. step1: Using point Ids of the models, I pick three arbitrary points A,B and C. step2: I define two vectors X1 and X2 orthogonal to AB.Now, AB,X1 and X2 make another basis for the model. step3: I calculate the new coordinates of all the points in this new basis, let us call these transformed coordinates V'. step4: I rotate the model M to some arbitrary degree and then repeat step1 through step 3 to find the transformed coordinates for the rotated model(V'_rotated). As the new basis system also rotates the same extent as all the other points in the system and the orientatin & geometry of a point doesnt change with reference to the new basis, I guess the V' and V'_rotated must be the same.But when I do it practically, they are different!! Is there any problem with the logic?What is your opinion about it ? This problem has made me crazy, PLEASE HELP !!! Best Regards, Justujo

##### Share on other sites
Quote:
 Original post by justujostep2: I define two vectors X1 and X2 orthogonal to AB.Now, AB,X1 and X2 make another basis for the model.

That doesn't necessarily define a basis. Basis vector must be perpendicular to each other and must be of unit length. You say that X1 and X2 are orthogonal to AB, but are they orthogonal to each other? Are all three vectors of unit length?

##### Share on other sites
Sorry, I forgot to clarify that.X1,X2 and AB are orthogonal to each other and they are unit vectors.

X1= AB cross AC
X2= AB cross X1

X1,X2 and AB normalised to unity vecotors by dividing by their magnitudes.

##### Share on other sites
How are you calculating the new points in respect to the new basis?

##### Share on other sites
Another "just to make sure" question - in step 1 you pick 3 arbitrary points. After doing step 4, are you choosing the same points as in step 1 (of course the points are now in a new coordinate space)? If you are choosing them randomly again, you might get a different basis.

##### Share on other sites
Quote:
 Original post by WolfdogHow are you calculating the new points in respect to the new basis?

By solving the system of linear equations: Lq= p where

L= [Ax Ay Az; X1x X1y X1z; X2x X2y X2z] //A square matrix representing the new
//basis vectors A,X1 and X2

p=[v1x v2x v3]// coordinates of the point(in global coordinate system ) which we //want to transform

q=[q1 q2 q3] // coordinates of the point v in new basis system

Quote:
 Original post by Gage64Another "just to make sure" question - in step 1 you pick 3 arbitrary points. After doing step 4, are you choosing the same points as in step 1 (of course the points are now in a new coordinate space)? If you are choosing them randomly again, you might get a different basis.

Yes I choose the same points in the step 4 as I did in step 1.

I really appreciate your support guys.
Best Regards

##### Share on other sites
Quote:
 Original post by justujop=[v1x v2x v3]// coordinates of the point(in global coordinate system ) which we //want to transform

This looks odd, shouldn't it be p=[x y z] of the point?

##### Share on other sites
Quote:
Original post by Wolfdog
Quote:
 Original post by justujop=[v1x v2x v3]// coordinates of the point(in global coordinate system ) which we //want to transform

This looks odd, shouldn't it be p=[x y z] of the point?

Pardon me for not writing it correctly.It must be p=[px py pz]

##### Share on other sites
Hello,

Another information about it. I have worked out the whole procedure on paper step by step. The code is functioning absolutely right. There is a problem in the logic , it seems now.

Kindly help me to figure that out

Regards

##### Share on other sites
Hi All,

I think I have figured out where the problem lies.I want the new basis to be rotation invariant.For that, we need to locate the origin of the new basis system on the point A.In other words, point A must behave as the new origin of the new basis system.For some reason, the new basis system is using the origin of the world coordinate system as its origin.I have observed the coordinates of point A in the new basis system are not (0,0,0) rather it has some non zero values.

So the solution might be to do something to translate the new basis system to A from origin of global coordinates?

What is your opinion ....

Best Regards,

1. 1
2. 2
3. 3
Rutin
13
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633697
• Total Posts
3013404
×