Jump to content

  • Log In with Google      Sign In   
  • Create Account

How To Perform Matrix Dot Product On D3Dx9?

  • You cannot reply to this topic
5 replies to this topic

#1   Members   -  Reputation: 1100

Like
0Likes
Like

Posted 30 July 2016 - 11:38 PM

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


Edited by lucky6969b, 30 July 2016 - 11:38 PM.


#2   Members   -  Reputation: 4335

Like
0Likes
Like

Posted 31 July 2016 - 03:16 AM

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


#3   Members   -  Reputation: 2057

Like
0Likes
Like

Posted 31 July 2016 - 06:59 AM

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:


#4   Members   -  Reputation: 1100

Like
0Likes
Like

Posted 01 August 2016 - 12:29 AM

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


Edited by lucky6969b, 01 August 2016 - 12:30 AM.


#5   Members   -  Reputation: 1525

Like
0Likes
Like

Posted 01 August 2016 - 12:08 PM

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.



#6   Members   -  Reputation: 1100

Like
0Likes
Like

Posted 04 August 2016 - 02:15 AM

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

It is in here

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







PARTNERS