Jump to content
  • Advertisement
Sign in to follow this  
Xetheriel

OpenGL OpenGL Transformation issues

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

Okay, so I have my transformation node setup to calculate the final transformation of the object under it to do this I do this:
	void Update()
	{
		this->FinalMatrix = LocalMatrix * ParentNode->FinalMatrix;
		glMatrixMode(GL_MODELVIEW);
		glPushMatrix();
		glLoadMatrixf(this->FinalMatrix.readArray());
		CSceneNode::Update();
		glPopMatrix();
	}
This should set FinalMatrix up and use it to draw the next model.. Here is the * operator overloaded
inline Matrix4 operator* (const Matrix4& m1, const Matrix4& m2) {
	Matrix4 retVal;
	for (int x=0;x<4;++x) for (int y=0;y<4;++y) {
		retVal(x)[y] = 0;
		for (int i=0;i<4;++i) retVal(x)[y] += m1[y] * m2[x];
	}
	return retVal;
}


And finally, I suppose you should see the drawglscene function:
void DrawGLScene () 
{ 

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	
	glLoadIdentity();
	RootNode->Update();
	glLoadIdentity();
	Cam.SetPrespective();
	CheckKeys();
	CheckMouse();    

}


Now this code compiles fine, but when the program actually starts up, I'm not looking at what I should, I don't think the model is where it should be, my camera is locked, cant move it... What in the world is going on here? If you need more information just ring a bell, or am I doing something horribly wrong in my code I gave you?

Share this post


Link to post
Share on other sites
Advertisement

This topic is 4551 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.

Guest
This topic is now closed to further replies.
Sign in to follow this  

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