?
Solved

Calculate Transformation Matrix based on two 3D points

Posted on 2008-10-28
4
Medium Priority
?
1,417 Views
Last Modified: 2013-12-26
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
0
Comment
Question by:toni_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 27

Expert Comment

by:aburr
ID: 22828537
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.
0
 

Author Comment

by:toni_
ID: 22828638
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
0
 
LVL 27

Expert Comment

by:aburr
ID: 22828695
I am not familiar with Solidworks or the API so I will not be of much more help to you.
0
 
LVL 20

Accepted Solution

by:
ikework earned 1500 total points
ID: 22829275
hey toni_

well the translational part of the matrix is easy, just put the midpoint in the 4th row or col (depending on if you use column-major- or row-major-matrices) of the matrix. if p is the midpoint, then:

for column-major-matrix:

1    0    0    p.x
0    1    0    p.y
0    0    1    p.z
0    0    0    1

you need to tell us more about the desired rotation to help you making the rotational part of the matrix, but start with the translational part and check if it works ..

ike
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction On a scale of 1 to 10, how would you rate our Product? Many of us have answered that question time and time again. But only a few of us have had the pleasure of receiving a stack of the filled out surveys and being asked to do somethi…
Article by: Nicole
This is a research brief on the potential colonization of humans on Mars.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question