View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# D3DXVec3TransformCoord

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1Mythar  Members

Posted 16 April 2000 - 08:24 AM

Hi all, dose anyone know the source for the D3DXVec3TransformCoord function ?

### #2Andreas Jonsson  Moderators

Posted 16 April 2000 - 09:07 AM

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

### #3Mythar  Members

Posted 16 April 2000 - 09:03 PM

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)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.