Link to home
Start Free TrialLog in
Avatar of toni_
toni_Flag for Canada

asked on

Calculate Transformation Matrix based on two 3D points

Hello,
Is it possible to calculate the transformation matrix based on two 3d points and if so how? I am trying to place a tube part between these two 3d points and need the transformation matrix to position/place the part properly.

Thanks
Avatar of aburr
aburr
Flag of United States of America image

I cannot give you the code for whatever program you are using but it seems to me that a translation and a rotation ought to do it. Translate the center of the tube to the midpoint between your 3D points, Then rotate the axis of the tube to coincide with the line between the two points.
Avatar of toni_

ASKER

Thanks for the reply aburr,
It is this "rotate the axis of the tube to coincide with the line between the two points" that I am not sure how to do. I am using Solidworks and looking at the API I would need to just plug in the transformation matrix for that part to be positioned and rotated properly. It is the math that I am not sure how to calculate
I am not familiar with Solidworks or the API so I will not be of much more help to you.
ASKER CERTIFIED SOLUTION
Avatar of ikework
ikework
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial