XMVector3Project implementation

Started by
2 comments, last by neeker 10 years, 3 months ago

Hi,

I need to transform an object's world coordinate vertex into screen coordinates. It seems like XMVector3Project would do this, but unfortunately I can't use DXMath so I have to come up with the implementation by hand.

My linear-algebra-mojo isn't that strong, so I'm having a difficult time figuring out exactly what this function does. Anyone know for sure?

Advertisement

Why exactly can't you use DXMath? (or the older and now deprecated XNAMath, or the even older D3DX* math functions, each one has a project/unproject set).

Anyways, you can check out the source for D3DXVecProject here, which is the older, scalar version, and should be a little easier to understand and copy into an existing project, all you need is matrix by matrix and matrix by vector multiplies.

Anyways, you can check out the source for D3DXVecProject here, which is the older, scalar version, and should be a little easier to understand and copy into an existing project, all you need is matrix by matrix and matrix by vector multiplies.

That's exactly what I was looking for Necrolis! I can't use any extensions of DirectX (DXMath, D3DX, etc.) due to project requirements, so mostly I've been copying the wine implementations of the D3DX functions I've needed. I didn't realize there was a version implemented in D3DX. Kudos.

It seems like the commit in that link was a little garbled. You can find the same commit here in original form.

This topic is closed to new replies.

Advertisement