How To Perform Matrix Dot Product On D3Dx9?

Started by
4 comments, last by lucky6969b 7 years, 8 months ago

http://www.mvps.org/DirectX/articles/math/dot/index.htm

Is it possible to do dot product on a vector with matrices in D3DX9?

I am trying to convert this project into C++ equivalence...

https://github.com/unr-arl/DubinsAirplane

In the python code


np.dot(rotz(pi/2), np.array([cos(anglstart), sin(anglstart), 0]).T)

It is trying to compute the dot product of a rotation matrix around z axis and dot with

a column vector...

https://msdn.microsoft.com/en-us/library/windows/desktop/bb205508(v=vs.85).aspx

The D3DXVec3Dot only works with dotting two vectors together?

Thanks

Jack

Advertisement
Not 100% sure, but I think it's just a vector matrix multiplication (D3DXVec3TransformCoord). Which technically does a number of dot products to get the final result.

Otherwise maybe you have to extract a vector from one of the rows or columns and dot that with your vector.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

I have no idea what that is trying to do but you can try to work it out from this:

https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.dot.html#numpy.dot

For 2-D arrays it is equivalent to matrix multiplication, and for 1-D arrays to inner product of vectors (without complex conjugation). For N dimensions it is a sum product over the last axis of a and the second-to-last of b:

Is it the 2D array case (the first is 2d)? In which case you could replace it with matrix multiplication. I don't know what .T is doing to it though (I don't know any Python).

Interested in Fractals? Check out my App, Fractal Scout, free on the Google Play store.

Just to make sure.

Because my game needs my vehicles to pathfind on ramps,

I am not sure if 3D dubins is needed when calculating subpaths

on ramps....

Because in flat ground case, 2D dubins is needed,

Is 3D case similiar to this?

Thanks

Jack

The dot/inner product is define for vectors ( in the broadest sense ) NOT matrices. Are you referring to matrix-vector? Although one can think of a matrix-vector multiplication as a sequence of dot-product between the column/row vectors of the matrix with the input vector.

Guess what. I just discovered there is a C++ version of NumPy out there.

It is in here

https://github.com/ndarray/Boost.NumPy

This topic is closed to new replies.

Advertisement