Sign in to follow this  

XMVector3Project implementation

This topic is 1442 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

 

Share this post


Link to post
Share on other sites

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.

 

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

This topic is 1442 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this