Jump to content
  • Advertisement
Sign in to follow this  
justujo

Help needed about Change of basis !

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by justujo
step2: 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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Wolfdog
How 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 Gage64
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.


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 this post


Link to post
Share on other sites
Quote:
Original post by justujo
p=[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 this post


Link to post
Share on other sites
Quote:
Original post by Wolfdog
Quote:
Original post by justujo
p=[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 this post


Link to post
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 this post


Link to post
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 ....

waiting anxiously for your reply,

Best Regards,

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!