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


Crash when z camera cordinate goes greater than -1

Recommended Posts

Hey All, I am having a problem with d3d LH camera system, when I move the camera from point to anything greater than -1 the game will crash... I can set it manually in the code to anything I want and it compiles and works fine. It just keeps crashing every time I map controlling the z coordinates to keyboard buttons and goes greater than -1. Here is the code I am calling every Frame that updates the camera''a position, which seems to be causing the crash: // Move the camer along the z-axis if( m_bKey[''Z''] ) m_vFromPt.z++; if( m_bKey[''X''] ) m_vFromPt.z--; // Set the view matrix. D3DXMATRIX matView; D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f ); D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f ); D3DXMatrixLookAtLH( &matView, &m_vFromPt, &vLookatPt, &vUpVec ); m_pd3dDevice->SetTransform( D3DTS_VIEW, &matView ); sprintf( strStatus, "Camera cords = (%f, %f, %f)", m_vFromPt.x, m_vFromPt.y, m_vFromPt.z );

Share this post

Link to post
Share on other sites