Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3352334
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:01:03+00:00 2026-05-18T02:01:03+00:00

When representing a mathematical matrix, rotations are performed as follows: http://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations Rx(θ) = 1

  • 0

When representing a mathematical matrix, rotations are performed as follows:

http://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations

Rx(θ) = 1  0      0
        0  cos θ  -sin θ
        0  sin θ  cos θ

Ry(θ) = cos θ  0  sin θ
        0      1  0
        -sin θ 0  cos θ

Rz(θ) = cos θ  -sin θ  0
        sin θ  cos θ   0
        0      0       1

However, I’ve discovered that Direct3D uses the transpose of these rotation matrices.

In my app I have a generic Matrix class which uses the standard mathematical rotation representations. With a simple rotation about 1 axis, it is easy to convert to a Direct3D matrix, as you can just do the transposition. However, if you rotate about x, y and then z you cannot simply get the transposed matrix.

My question is, how can I convert a mathematical matrix in to a Direct3D matrix?

Here is an example:

Matrix matrix;
matrix.RotateX(1.0f);
matrix.RotateY(1.0f);
matrix.RotateZ(1.0f);

Mathematical matrix =
m_11 0.29192656 float
m_12 -0.45464867 float
m_13 0.84147096 float
m_14 0.00000000 float
m_21 0.83722234 float
m_22 -0.30389664 float
m_23 -0.45464867 float
m_24 0.00000000 float
m_31 0.46242565 float
m_32 0.83722234 float
m_33 0.29192656 float
m_34 0.00000000 float
m_41 0.00000000 float
m_42 0.00000000 float
m_43 0.00000000 float
m_44 1.0000000 float

Direct3D matrix =
_11 0.29192656 float
_12 0.45464867 float
_13 -0.84147096 float
_14 0.00000000 float
_21 -0.072075009 float
_22 0.88774973 float
_23 0.45464867 float
_24 0.00000000 float
_31 0.95372111 float
_32 -0.072075009 float
_33 0.29192656 float
_34 0.00000000 float
_41 0.00000000 float
_42 0.00000000 float
_43 0.00000000 float
_44 1.0000000 float

Edit: Here are some examples of individual rotations.

X-Axis rotation by 1 radian
My matrix class:

1.0000000    0.00000000    0.00000000    0.00000000
0.00000000   0.54030228   -0.84147096    0.00000000
0.00000000   0.84147096    0.54030228    0.00000000
0.00000000   0.00000000    0.00000000    1.0000000

Direct3D:

1.0000000    0.00000000    0.00000000    0.00000000
0.00000000   0.54030228    0.84147096    0.00000000
0.00000000  -0.84147096    0.54030228    0.00000000
0.00000000   0.00000000    0.00000000    1.0000000

As you can see, the Direct3D matrix is exactly the transpose of my matrix class (my class gives the same results as the examples given by Wikipedia at the top of this question).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:01:03+00:00Added an answer on May 18, 2026 at 2:01 am

    I’ve always traced this confusion back to the late 80s. As I remember it, there were two particularly influential books on graphics at the time. One of them wrote vectors as row vectors on the left of matrices; the book was quite hardware oriented – conceptually you thought of the vectors as flowing left-to-right through a pipeline of transform matrices. Rendermorphics (which was later picked up by Microsoft to become Direct3D) went down this route. The other book wrote vectors as column vectors on the right of matrices, which is the way OpenGL does it (and I think most mathematicians would naturally gravitate towards this, although I have met exceptions).

    However, both approaches are entirely equally valid mathematics! If you’re confused by Direct3D, start thinking in terms of writing row vectors on the left of matrices, not in terms of transposing the matrices.

    You’re not the first person to be confused by this (see also).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am representing map ( matrix rows x columns ) with bits using bitset
Consider the following picture representing the WCF channel stack: alt text http://i.msdn.microsoft.com/ee672186.image001(en-us).jpg I'm implementing
I have a bunch of strings representing mathematical functions (which could be nested and
I have some XML data representing a mathematical expression tree and want to convert
For representing a length or count variable, is it better to use signed or
I have a graph representing users and some articles they wrote. I need to
I have a variable representing a bmp image with the following structure: image=[line1, line2,
I have a prototype representing a particual IFrame. That prototype have a function called
When should I consider representing the primary-key as classes ? Should we only represent
I have 3d-data representing the atmosphere. Now I want to interpolate this data to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.