Questions tagged [directxmath]

DirectXMath API provides common linear algebra and graphics math operations to DirectX applications

Filter by
Sorted by
Tagged with
0
votes
0answers
38 views

XMMATRIX performance

Dears, I am facing a performance problem when I try to access cell 42 and 43 in XMMATRIX define in DirectXMath.h. The frames dropped by 100 FPS. Here is my code: ...
0
votes
1answer
81 views

What exactly does XMMatrixPerspective{L,R}H do?

There are generally three functions to create a perspective matrix in DirectXMath, XMMatrixPerspective{L,R}H, ...
2
votes
1answer
537 views

2d Scale width and height based on distance

I'm drawing a health bar on top of each player. I transform 3d position to 2d. I would like to draw it smaller when distance increases. Any simple math for that? Let's say bar width is 30 and height ...
0
votes
1answer
247 views

Transforming quaternion between coordinate systems [duplicate]

Working in DirectX (with DirectXMath objects): If I have the rotation of an object relative to some coordinate space as quaternion Q, and I have a transformation matrix tx from that coordinate space ...
1
vote
0answers
80 views

how to debug calculating tangent space

[][]2 there's problem calculating tangent space and look.... it seems there is no problem with UV code and my shader is 100% no problem. I just copy and pasted tutorial code which works well.. I ...
1
vote
1answer
301 views

Why doesn't TriangleTests::Intersects from DirectXMath work correctly?

I am currently looking through the Introduction to 3D Game Programming with Direct X 11 by Frank Luna and I'm trying to implement the ray-triangle intersections. I already have a ray firing when the ...
0
votes
2answers
98 views

Is there something similar to XMFLOAT2 that has its operators overloaded?

Since XMFLOAT2 is just a structure, I'm sure it does not have operator overloading which is what I need to make things a lot simpler. Is there something like ...
8
votes
0answers
69 views

How to clip cut-off using different frustrum than that of original camera? How to cut plane by pyramid shape?

SOURCE : http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/Mitchell_LightShafts.pdf This process is part of creating light draft effect. And I am suggested to do the described process in ...
0
votes
1answer
387 views

Difference between column- and row vector matrix multiplication (vector transform)

Let's say we have a 4-by-4 matrix A which represents some transformation. We can use this matrix to transform a vector in two ways. ...
2
votes
2answers
3k views

Calculate matrix transformation components separately

It is possible to calculate the translation, rotation and scale that were used to build a matrix? I mean if I have a matrix M can I calculate the rotation, scale, ...
1
vote
2answers
905 views

How to rotate camera using mouse?

I'm looking for a basic example of rotating camera using the mouse. the only problem is I'm not sure of how to rotating the camera around it target. should i do this by an algorithm or is there a ...
3
votes
1answer
160 views

How can I get projected coordinates of vertex on screen

I want to check picking for faces and for that I need projected X Y coordinates of my vertexes in -1 to 1 range: For that I multiply my vertex array with matrices and then get projected triangle ...
-1
votes
1answer
110 views

Simulating aircraft movement with DirectX 9 [closed]

How would I go about simulating a planes movement in DirectX 9 using transforms (i.e. matrices). For example flying around an open space. When it moves it faces the direction it is going and ...
1
vote
3answers
2k views

How do I correctly multiply an XMMATRIX by a scalar?

Using DirectXMath and its XMMATRIX structure in C++ and Direct X 11, how does one multiply that matrix structure by a single float scalar? I want to implement the ...
1
vote
1answer
247 views

Can I use memcpy() with XMMATRIX?

I.e. can I do this: XMMATRIX dxMat; Matrix myMat; std::memcpy(&myMat, &dxMat, sizeof(XMMATRIX)); std::memcpy(&dxMat, &myMat, sizeof(XMMATRIX)); <...
0
votes
2answers
266 views

Copy unaligned XMVECTOR and use the copy?

I know XMVECTOR has to be 16-byte-aligned and therefore shouldn't be a member of a class (unless I ensure the alignment). However, can I do sth like this? ...