Jump to content
  • Advertisement


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


Rotate my camera!

This topic is 5874 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

Grrr, now I´ve tried to use quats to rotate my camera around it´s own axis but when I try to do this I get nothing on my screen. What am I doing wrong? I really don´t know anythiing about quats....or maybe some but I just want to get this working asap Any help appreciated!
void cGraphics::RenderBox(void)
	D3DXMATRIX matWorld;
	m_iD3DDevice8->SetTransform(D3DTS_WORLD, &matWorld);

	D3DXMATRIX m_matView;
	D3DXMATRIX m_matOrientation; 

	D3DXQuaternionRotationYawPitchRoll(&qR, 0.0f, 0.0f, 0.0f);  
	D3DXMatrixAffineTransformation(&m_matOrientation, 1.25f, NULL, &qR, &D3DXVECTOR3(0.0f,0.0f,0.0f));  
	D3DXMatrixInverse( &m_matView, NULL, &m_matOrientation );  
	m_iD3DDevice8->SetTransform(D3DTS_VIEW, &m_matView);

	D3DXMATRIX matProj;
	D3DXMatrixPerspectiveFovLH(&matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f);
	m_iD3DDevice8->SetTransform(D3DTS_PROJECTION, &matProj);

	m_iD3DDevice8->SetTexture(0, m_iD3DBoxTexture8); //Set the texture

	m_iD3DDevice8->SetStreamSource(0, m_iD3DBoxVertBuf8, sizeof(CUSTOMVERTEX));
	m_iD3DDevice8->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0,2);


Bad Monkey Productions

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!