Advertisement Jump to content


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


World/View Matrix

This topic is 5485 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! i want to use my own view and world matrix instead of using glTranslatef, etc. (i''m using opengl) hi calculate my worldmatrix this way (for each scenenode in the world):
void CSceneNode::MakeTransform(const CVector3& position, const CVector3& scale, const CQuaternion& orientation, CMatrix4& destMatrix) const
	destMatrix = CMatrix4::IDENTITY;
	//  1. Skalierung
	//  2. Rotatation
	//  3. Translation

	CMatrix3 rot3, scale3;

	scale3 = CMatrix3::ZERO;
	scale3.m[0] = scale.x;
	scale3.m[4] = scale.y;
	scale3.m[8] = scale.z;

	destMatrix = rot3 * scale3;

and my view matrix i calculate this way:
void CCamera::UpdateViewMatrix()
	CMatrix3 rot;

	//Translation relativ zu neuer Achse
	CMatrix3 rotT = rot.Transpose();
	CVector3 trans = -rotT * mAbsPos;

	mViewMatrix = rotT;
	mViewMatrix.m[12] = trans.x;
	mViewMatrix.m[13] = trans.y;
	mViewMatrix.m[14] = trans.z;
	mViewMatrix.m[15] = 1.0f;

before rendering the scenenode I set the world and view matrix (so i multiply them)

my problem is that the camera seems to rotate around the 0,0,0 Vector.
do you have any idea what''s wrong?
(the rotations for scenenode work fine, the problem just occurs with the camera ...)

thanks in advance.
guts (you know, the guy form berserk :D)

Share this post

Link to post
Share on other sites

  • 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!