Skip to main content
gamedev.net
🔒 Locked

D3DXMATRIX Structure Problem

Started by sansured 0 replies 550+ views
Original Post
sansured
sansured
I am trying to open BSP map in my 3D Game Engine but i have a problem. In the begining i was using D3D 9.0 SDK Update December 2004 but now i am using D3D 9.0 SDK Update August 2005. Now that's my question. In old SDK for FPS view i create four structures like

        D3DXVECTOR3 vFromPt;

        D3DXVECTOR3 vLookatPt;

        D3DXVECTOR3 vUpVec;

        D3DXVECTOR3 m_vRight;
and for using BSP map i do something like that

        D3DXMATRIX view;
	D3DXMatrixIdentity( &view );

	D3DXVec3Normalize( &vLookatPt, &vLookatPt );
	D3DXVec3Cross( &m_vRight, &vUpVec, &vLookatPt );
	D3DXVec3Normalize( &m_vRight, &m_vRight );
	D3DXVec3Cross( &vUpVec, &vLookatPt, &m_vRight );
	D3DXVec3Normalize( &vUpVec, &vUpVec );

	view._11 = m_vRight.x;
        view._12 = vUpVec.x;
        view._13 = vLookatPt.x;
	view._14 = 0.0f;

	view._21 = m_vRight.y;
        view._22 = vUpVec.y;
        view._23 = vLookatPt.y;
	view._24 = 0.0f;

	view._31 = m_vRight.z;
        view._32 = vUpVec.z;
        view._33 = vLookatPt.z;
	view._34 = 0.0f;

	view._41 = -D3DXVec3Dot( &vFromPt, &m_vRight );
	view._42 = -D3DXVec3Dot( &vFromPt, &vUpVec );
	view._43 = -D3DXVec3Dot( &vFromPt, &vLookatPt );
	view._44 =  1.0f;

	m_pd3dDevice->SetTransform( D3DTS_VIEW, &view ); 
But in the new SDK i am using CFirstPersonCamera class.The class is controlling every thing about the camera and i can't change anything properly. Is there anybody know's how can i do this operation for CFirstPersonCamera?Please Help. Thanks.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.