Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Mythar

D3DXVec3TransformCoord

This topic is 6731 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

Advertisement
Why do you ask?

The formula is:

In: VECTOR V, MATRIX M
Out: VECTOR V

float x,y,z,w;

x = V.x*M._11 + V.y*M._21 + V.z*M._31 + M._41;
y = V.x*M._12 + V.y*M._22 + V.z*M._32 + M._42;
z = V.x*M._13 + V.y*M._23 + V.z*M._33 + M._43;
w = V.x*M._14 + V.y*M._24 + V.z*M._34 + M._44;

V.x = x/w;
V.y = y/w;
V.z = z/w;

If you look in D3DUtil.cpp or D3DMath.cpp you can see Microsoft''s implementation. Of course they may have changed it slightly for D3DX, most likely to support Intel and AMD specific code, but the principle is the same.

WitchLord

Share this post


Link to post
Share on other sites
Thx, for the code.
The reson I asked, is that I program in Delphi, and have to re-write the code from c++
(can''t use the c++ lib''s in Delphi)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!