Solved

Calculate Transformation Matrix based on two 3D points

Posted on 2008-10-28
4
1,416 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Complex Numbers are funny things.  Many people have a basic understanding of them, some a more advanced.  The confusion usually arises when that pesky i (or j for Electrical Engineers) appears and understanding the meaning of a square root of a nega…
Lithium-ion batteries area cornerstone of today's portable electronic devices, and even though they are relied upon heavily, their chemistry and origin are not of common knowledge. This article is about a device on which every smartphone, laptop, an…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

691 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