Advertisement Jump to content
Sign in to follow this  

Confused with xnamath XMMatrixLookAtLH()

This topic is 3242 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, Im tryng to make the transition from d3dxmath to xnamath, but Im stucked... Everything was ok using XMFLOAT3, since is the same as using D3DXVECTOR3, but when I get on using XMMatrixLookAtLH I just figured I dont know a damn about this.. It uses FXMVECTOR as input params, I dont have idea on how initialize this with a FLOAT3 vector...The most annoying is that I cant find any exemple on internet about this! How can that be? I get on this:
	XMFLOAT3 _pos( 0.0f, 1.0f, -5.0f );
	FXMVECTOR pos = XMLoadFloat3( &_pos );

	XMFLOAT3 _aim( 0.0f, 0.0f, 0.0f );
	FXMVECTOR aim = XMLoadFloat3( &_aim );

	XMFLOAT3 _up( 0.0f, 1.0f, 0.0f );
	FXMVECTOR up = XMLoadFloat3( &_up );

	g_mView = XMMatrixLookAtLH( pos, aim, up );

But it is so overheaded, if thats the right way isnt better to use d3dxmath?

Share this post

Link to post
Share on other sites
FXMVECTOR is for passing parameters to functions. Use XMVECTOR and you should be fine.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!