Solved

Calculate Transformation Matrix based on two 3D points

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Manufacturing a NPK fertlizer 7 24
Fix45 challenge 15 88
Math Stumper 6 39
Game Asset Design and Performance. 7 85
Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
Have you ever thought of installing a power system that generates solar electricity to power your house? Some may say yes, while others may tell me no. But have you noticed that people around you are now considering installing such systems in their …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now