I'm translating a bit of code into javascript. I'm trying to replicate the functionality of
D3DXVECTOR3* D3DXVec3TransformCoord(
__inout D3DXVECTOR3 *pOut,
__in const D3DXVECTOR3 *pV,
__in const D3DXMATRIX *pM
);
This applies Mat4 transformation to the Vec3 (which would lead to an invalid mat4). How do I project the 4d matrix into the 3d matrix and perform the operation? In what order would you do the math? We can assume that W=1, as in the following post: