Solved

Calculate Transformation Matrix based on two 3D points

Posted on 2008-10-28
4
1,411 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_
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
This article seeks to propel the full implementation of geothermal power plants in Mexico as a renewable energy source.
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…
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…

809 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