Questions tagged [directxmath]

The DirectXMath API provides SIMD-friendly C++ types and functions for common linear algebra and graphics math operations common to DirectX applications.

The DirectXMath API provides SIMD-friendly C++ types and functions for common linear algebra and graphics math operations common to DirectX applications. The library provides optimized versions for Windows 32-bit (x86), Windows 64-bit (x64), Windows RT, and Windows Mobile through SSE and ARM-NEON intrinsics support in the Visual C++ compiler.

Source: MSDN

DirectXMath is also hosted on GitHub

57 questions
0
votes
1 answer

DirectX::XMMATRIX Multiplication incorrect after function pass (C++)

I am having some trouble understanding why I am getting different results when multiplying two DirectX 4x4 matrices together, depending on whether the multiplication is performed within a class function or not. Using identity matrices as an…
nat1707828
  • 877
  • 2
  • 11
  • 18
0
votes
1 answer

GXMVECTOR - Documentation?

I am trying to re-learn directx after a decade of doing other things. I read a tutorial on the github wiki on how to render some sprites: https://github.com/Microsoft/DirectXTK/wiki/Sprites-and-textures In the Draw method it uses…
Christopher Pisz
  • 3,757
  • 4
  • 29
  • 65
0
votes
1 answer

C++ template related error with XMVectorPermute

I'm new to DirectX11 and I'm trying to adapt a file written using DirectX Legacy to new DirectX but I'm having some trouble with template XMVectorPermute, which used to be a function in Legacy file. I'm trying to make compiler recognize the template…
tigerccx
  • 47
  • 6
0
votes
1 answer

Working with DirectXMath and D3DXMath

Back in D3DXMath we had ability to multiply, add or subtract even divide vector types, which were D3DXVECTOR2, D3DXVECTOR3, D3DXVECTOR4 structures..... Now in DirectXMath incarnation we have XMFLOAT2, XMFLOAT3, XMFLOAT4 and …
0
votes
1 answer

DirectXTK and 3D Ojbect

I have an application that displays 3D object using D3D11 and DirectXMath. I also want to display a HUD in the Top Left Corner so i thought i would use DirectXTK sprintBatch/spriteFont to do this. My 3D is fine until i add the following code. Is…
0
votes
1 answer

DirectXMathConvert.inl assertion failure (DirectXMathConvert.inl line 704)

Would someone be kind enough to translate me this piece of code to human readable ? |704| assert(((uintptr_t)pSource & 0xF) == 0); Basically this assertion fails in my program, but not 100% of the time (without I recompile anything) which is rather…
PinkTurtle
  • 6,942
  • 3
  • 25
  • 44
0
votes
3 answers

DirectXMath.h operator ambiguity

I recently wrote a matrix class to deal with XMFloat4x4 and XMVector transformations. It was working great on windows 8 metro apps but when I tried to port it to Win32 Windows application, it started giving error "error C2593: 'operator *' is…
amuTBKT
  • 1
  • 2
0
votes
1 answer

Is there a way to convert a quaternion to angles?

I have a (world) matrix, and it applies translation, rotation and scale into an 3D object. It is created with the function XMMatrixTransformation (DirectXMath) and the parameter RotationQuaternion is made by a call to…
LHLaurini
  • 1,737
  • 17
  • 31
0
votes
1 answer

DirectXMath Unproject on the wrong axis

EDIT: Solved the issue, see my own answer Recently I've been working on a 3D world editor that will be using picking to raise or lower terrain. I'm using camera unprojection and ray casting to find the world position of the mouse screen coordinates.…
0
votes
1 answer

How to use Xmfloat in class (Migrating from d3dx)

I'm trying to migrate to directxmath, but the new code is giving me some trouble.. class Vec3 : public XMFLOAT3 { public: inline float Length() { return XMVector3Length(this); } inline Vec3 *Normalize() { return static_cast( …
LemonCold
  • 96
  • 6
0
votes
1 answer

Matrixmultiplication with DirectXMath

I did the tutorial http://3dgep.com/introduction-to-directx-11. In the tutorial 3 matrices (the projection, view, and world matrix) are send to the vertexshader and are multiplied there. I want to multiply the 3 matrices to get only one which I…
CrazySocke
  • 13
  • 5
0
votes
1 answer

How can I simplify matrices multiplication at DirectX11?

Can I simplify following statement to make it more human readable? Can I do following multiplication step-by-step regarding aligning requirements? DirectX::XMStoreFloat4x4(&this->worldTransform,…
Charlie
  • 3
  • 1
0
votes
1 answer

Is XMMATRIX efficient for 2D transformations or should I make a custom 3x3 matrix suite?

I'm building a high-performance UI layout engine on top of Direct3D 11. The application is being developed using Visual Studio 2013, targeting x64 and is intended for Windows 7 (with Platform Update) and up. I need to do matrix transformations on 2D…
d7samurai
  • 3,086
  • 2
  • 30
  • 43
0
votes
0 answers

Calculating 3D World intersection

How would I calculate the Intersection Point at the terrain in a World with the World, view and projection matrices. Now lets say that the intersection Point should be calculated from my 2D cursor coordinates and the part of the terrain behind my…
0
votes
1 answer

AccessViolation only in Optimised Win32 Build (XMMATRIX)

I'm having some trouble setting two variables of type XMMATRIX** in a function. The function prototype looks like this: bool ViewportFactory::CreateViewport(CanvasHandle* canvasHandlePtr, ViewportHandle** outViewportHandlePtr, DirectX::XMMATRIX**…
Xenoprimate
  • 7,691
  • 15
  • 58
  • 95