-1
\$\begingroup\$

How can i translate the code to directxmath code?

// Create a quaternion that rotates about the world up
 Quaternion quatYaw = CreateFromAxisAngle( Vector3(0,1,0), yaw )
 // Transform the camera offset and up by this quaternion
 offset = Transform( offset, quatYaw)

Do i use XMQuaternionRotationAxis for CreateFromAxisAngle? And also, what function do i use for: Transform

I need to use functions from DIRECTXMATH https://docs.microsoft.com/en-us/windows/win32/api/directxmath/

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

Do I use XMQuaternionRotationAxis for CreateFromAxisAngle?

Yes.

What function do I use for: Transform

You use XMVector3Rotate.

You can find these matches just by comparing the function signatures, or plugging "DirectXMath rotate vector by quaternion" into a search engine (this was on the first page of results)..

\$\endgroup\$
1
  • 1
    \$\begingroup\$ This page on Microsoft Docs has a complete table of D3DXMath to DirectXMath conversions. \$\endgroup\$ Commented Jan 8, 2021 at 9:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.