• Advertisement

Archived

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

Camera Track

This topic is 5946 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
if you are using direct 3d, use the D3DXMatrixLookAtLH function to generate a view matrix that pints at the coordinates of the moving object ear frame. If not, here is the documentation for the function so you can make your own (note this is left handed):

  
D3DXMATRIX* D3DXMatrixLookAtLH(
D3DXMATRIX* pOut,
CONST D3DXVECTOR3* pEye,
CONST D3DXVECTOR3* pAt,
CONST D3DXVECTOR3* pUp
);

zaxis = normal(At - Eye)
xaxis = normal(cross(Up, zaxis))
yaxis = cross(zaxis, xaxis)

xaxis.x yaxis.x zaxis.x 0
xaxis.y yaxis.y zaxis.y 0
xaxis.z yaxis.z zaxis.z 0
-dot(xaxis, eye) -dot(yaxis, eye) -dot(zaxis, eye) 1

Share this post


Link to post
Share on other sites

  • Advertisement