Orientating objects to align with a specific axis

  • Context: Undergrad 
  • Thread starter Thread starter Adder_Noir
  • Start date Start date
  • Tags Tags
    Axis Specific
Click For Summary
SUMMARY

This discussion focuses on the method for orienting 3D objects, specifically how to align a cylinder with an arbitrary axis, such as (1,1,0). The user seeks a solution involving transform matrices and inverse matrices, leveraging DirectX functions for calculations. The key challenge lies in determining the correct order of X, Y, and Z rotations to achieve the desired alignment. A reference to a matrix FAQ resource is provided as a potential solution.

PREREQUISITES
  • Understanding of 3D coordinate systems
  • Familiarity with transformation matrices
  • Knowledge of DirectX functions for matrix operations
  • Basic concepts of rotation in 3D space
NEXT STEPS
  • Research how to create transformation matrices in DirectX
  • Learn about quaternion rotations for 3D object alignment
  • Explore the concept of axis-angle rotation
  • Study the application of inverse matrices in 3D graphics
USEFUL FOR

3D graphics developers, game developers, and anyone working with object transformations in computer graphics.

Adder_Noir
Messages
239
Reaction score
0
Hi!,

I'm well into the world of computer graphics. Love to say it was great but well, it isn't.

I would like to know how I can take any object and have it orientate so its centre aligns perfectly with any arbitrary axis.

Think of a cylinder at the origin pointing down the x-axis. Well I would like to know how I can rotate it so it points directly down an axis denoted by say (1,1,0) essentially in this theoretical case rotating it 45 degress. I haven't got a clue how to do this and I'm a bit thick too at times.

I know it has something to do with inverse matrices and such. I can get all the required inverse, determinant stuff from DirectX hard-coded functions so I don't even need to do much math I just need the solution method.

Any ideas? Naturally I can get a unit vector pointing down the required axis easily enough but how do I go about acquiring the necessary transform matrix to get something to go from its present position to be aligned with a new axis? Sure I know it's a concoction of X,Y, & Z rotations but hell which order to apply them in even if I did have the necessary rotations? I'm proper confused!

Thanks a lot for any help offered :wink:
 
Physics news on Phys.org
Hi this resource:

http://web.archive.org/web/20041029003853/http:/www.j3d.org/matrix_faq/matrfaq_latest.html"

Question 39 I believe firmly answers the question ;o)
 
Last edited by a moderator:

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 9 ·
Replies
9
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K