Archived

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

GekkoCube

digiben's camera

Recommended Posts

So im using digibens camera class. and im trying to implement a method to strife the camera. how can this be accomplished? void CCamera::StrifeCamera(float speed) { // this code moves the camera, NOT strife! // but i figured they are closely related! CVector3 vVector=CVector3(0, 0, 0); vVector.x = m_vView.x - m_vPosition.x; vVector.y = m_vView.y - m_vPosition.y; vVector.z = m_vView.z - m_vPosition.z; m_vPosition.x += vVector.x * speed; m_vPosition.z += vVector.z * speed; m_vView.x += vVector.x * speed; m_vView.z += vVector.z * speed; } ~ I am a DirectX to OpenGL convert! ~

Share this post


Link to post
Share on other sites
He''s got a strafing tutorial done up already, right?

http://www.gametutorials.com/download/OpenGL/Camera5_OGL.zip


If you can''t (or don''t want to) get this file, and if it''s a halfway normal camera, take the cross product of the direction vector and the up vector & move the camera by some multiple of that vector when strafing.

ld

Share this post


Link to post
Share on other sites