A cross platform math library for Windows and Xbox 360. Part of DirectX. (And, confusingly enough, not part of Microsoft's managed game platform, XNA.)
Questions tagged [xna-math-library]
20 questions
9
votes
4 answers
Crash after m = XMMatrixIdentity() - alignment memory in classes?
I was looking at the tutorials in DirectX SDK. Tutorial 5 works fine, but after I have copied and separated the code to my own classes, I got strange error during launching my application.
The line is:
g_World1 = XMMatrixIdentity();
Because of it,…

PolGraphic
- 3,233
- 11
- 51
- 108
8
votes
2 answers
Matrices causing crash
I have an odd problem with my Direct3D11 application that I'm trying to resolve for few hours already. The problem is that method:
void CameraClass::Render()
{
XMFLOAT3 sUp, sLookAt, sRotationInRadians;
sUp.x = 0.0f;
sUp.y = 1.0f;
…
user1367754
5
votes
2 answers
What is the best way to get distance between 2 points with DirectXMath
Using the new XMVECTOR and XMFLOAT3 classes what is the best way to get the distance between 2 points? I couldn't find a function that does it in XMVector* family of functions so I came up with the following :
float distance(const XMFLOAT3&…

Barış Uşaklı
- 13,440
- 7
- 40
- 66
3
votes
1 answer
Efficiently calculating normal using DirectXMath
I need to calcuate the normals of some triangles where I have a vector of vertices where each vertex has x, y, z coordinates. i1, i2, i3 are the indices in the vector of the three vertices of a triangle.
I'm using and wrote this…

jcoder
- 29,554
- 19
- 87
- 130
2
votes
1 answer
Function parameter passing of type XMVECTOR
Why is the definition of FXMVECTOR differ on 32-bit and 64-bit?
Why shouldn't pass XMVECTOR by reference on 32-bit to use the glory of SIMD?
Thank you in advance!

NMD
- 93
- 9
2
votes
1 answer
Is this a data alignment crash? (potentially involving stack misalignment, XNAMath, Visual Studio 2103)
My Win32, DirectX game is crashing in release mode within code that is manipulating vectors and matrices. Specifically the crash occurs on this instruction:
014E2752 unpcklps xmm1,xmmword ptr [esp+3Ch]
First-chance exception at 0x014E2752 in…

Raptormeat
- 312
- 2
- 14
1
vote
2 answers
How to properly use an XMVECTOR member variable
I have a simple IRenderable class that has members for position, scaling, and rotation:
XMFLOAT3 _position;
XMFLOAT3 _scaling;
XMVECTOR _rotation;
I am attempting to set them with the constructor. The first method here gives an access violation…

mikeschuld
- 943
- 1
- 11
- 25
1
vote
1 answer
Plotting 4 & 3 dimensional data - matlab
I have data set to plot with the following dimensions.
Density
Accessibility
Land use mix
Vibrancy
Help me with the steps of the task.
Expected output will be

Samith
- 11
- 1
1
vote
1 answer
DrawBone Angle variable using Kinect
when we want to draw Bones into XNA (using KnectSDK and C#), you have to calculate differences between two joints and draw bones between them. this is the function for drawing Bones:
private void DrawBone(JointCollection joints, JointType…

Nathan Drake
- 311
- 3
- 16
1
vote
1 answer
Is there an equivalent to XNA Math in SharpDX?
I bought this book "Introduction to 3D Programming with DirectX 11" hoping I could port everything to C# using SharpDX, because I don't know C++. Well, I can't seem to find SharpDX's wrapper classes for XNA Math and this book deals extensively with…

FinnTheHuman
- 1,115
- 13
- 29
1
vote
2 answers
New stops my object working correctly
I've had to completely rewrite this problem as I've found out a lot more about it now.
Background:
My programme is drawing some 3d objects under directx11. I have a class that contains the data, pointers, and functions needed to draw the required 3d…

David
- 1,050
- 1
- 16
- 31
0
votes
3 answers
Performance of vector assignment after function
I use this code:
MainLoop() {
for (int i = 0; i < length; i++) {
XMVector3Rotate(rays[i], orientation);
}
}
and I have fps 1900000, but when I use this one:
MainLoop() {
for (int i = 0; i < length; i++) {
…

itun
- 3,439
- 12
- 51
- 75
0
votes
2 answers
Invisible geometry in DX11
After struggling for many hours to understand and compensate for Microsoft's deprecation of D3DX in Windows 8, I've run into a problem that I can't shake off.
The first time I started my program, it became immortal because of an access violation.…
0
votes
1 answer
MD5 3D Model and Animation in Directx X 11. Normal Rotation to Update Model result in 1.#QNAN00
I try to load an animation from a MD5ANIM and a MD5Mesh file (3d animation and model Format in Doom) into my DX 11 deferred renderer.
Everything works fine except to the point where I have to Update the Models vertex positions and normals for the…
0
votes
1 answer
DirectX based struct in header file
I am relatively new to c++ and I am trying to create a struct accessible from multiple c++ files. To do so, I am writing it in a header file. However, the struct requires identifiers from a DirectX library, namely "xnamath.h".
My struct is as…

Jed
- 1
- 1