can you find the jittering ?...

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
muckelzwerg
Posts: 16
Joined: Wed May 04, 2005 11:38 am

can you find the jittering ?...

Post by muckelzwerg »

A while ago I tried to set up a primitive 3rdperson camera using the FPS camera.
I encountered a few problems and went for a different solution,
but that thing still bugs me.
I'm merely getting the cameras orientation an move it to look
at the desired target.
And somehow this results in massive jittering.
So I tried to update the positions, but that didn't help.
Without any position updates the image is jittery and seems to suffer from
the "transformation update after draw"-problem.
Using updataAbsolutePosition on the camera results in a clean displayed node. But it also results in seeing a "wrong frame" for an instant, while rotating the camera.Its not the last frame, its more like rotated around 90 degres.
The other position updates have no effect.
So can somebody tell me where the mistake is ?
Is it sth. I'm missing about the camera or the target node ?

Code: Select all

f32 camera_distance = 50.f;
void update_camera()
{

	//my_target_node->updateAbsolutePosition();
	//my_camera->updateAbsolutePosition();

	core::vector3df temp = my_camera->getTarget() - my_camera->getPosition();
	
	temp.normalize();
	my_camera->setPosition( (my_target_node->getPosition()) - temp*camera_distance );
	
	
	//my_target_node->updateAbsolutePosition();
	//my_camera->updateAbsolutePosition();
}
Post Reply