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 8135411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:24:42+00:00 2026-06-06T10:24:42+00:00

I need to get rotation matrix from direction vector (vForward) I also have vRight

  • 0

I need to get rotation matrix from direction vector (vForward) I also have vRight and vUp vectors. All those vectors are unit vectors.

I just need to get rotation matrix.

To get rotation matrix for rotation in only one plane (xy) parallel to ground, I do this:
XMMATRIX xmResult;

Vec3f vFwd = pPlayer->VForward;
vFwd.z = 0;
vFwd.Normalize();

xmResult = XMMatrixSet( vFwd.y,     -vFwd.x,    0,      0,
    vFwd.x,      vFwd.y,    0,      0,
    0,          0,          1,      0,
    0,          0,          0,      1);

Above code only get rotation matrix to rotate around Z axis:

I would like to get the code to rotate around all axis.
This is coordinate system I’m forced to use. I know it is strange:

Coordinate System I'm using

This is how I’m using my matrix later in code:

XMStoreFloat3((XMFLOAT3*)&vStart, XMVector3Transform(XMLoadFloat3((XMFLOAT3*)&vStart), xmTransformation));
XMStoreFloat3((XMFLOAT3*)&vEnd, XMVector3Transform(XMLoadFloat3((XMFLOAT3*)&vEnd), xmTransformation));
  • 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-06-06T10:24:44+00:00Added an answer on June 6, 2026 at 10:24 am

    Depending on how you use your matrices, Right, Up and Forward should correspond to the rows or columns of your matrix.

    xmResult = XMMatrixSet( vRight.x, vRight.y, vRight.z, 0, vFwd.x, vFwd.y, vFwd.z, 0, vUp.x, vUp.y, vUp.z, 0, 0, 0, 0, 1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need get all items these have no categories int? categoryId = null; var
I'm able to get CSS rotation setup for all browsers, but now I need
I have two tables with a weak relation. I need get a text value
I need to get all the objects whose id matches a specific pattern .
I need to get the size of a directory, recursively. I have to do
I want to read the pixels from the back buffer. But all i get
I have 2 points in X,Y + Rotation and I need to calculate a
I have rotated an image and need to get the new coordinates of a
Just need get some vals located in application.ini(main ini) in the Controller plugin I
Need to get the 10 word before and 10 words after for the given

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.