camera target odd behaviour

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
tstuefe
Posts: 40
Joined: Wed Jan 07, 2004 12:53 pm
Location: Heidelberg, Germany
Contact:

camera target odd behaviour

Post by tstuefe »

Hi all,

Thinking error or bug?

I set the target of the camera to point to a certain place, in this case, up at <1,1,1>. So the target should be something like (normalized) <0.56, 0.56, 0.56>. But the camera does not point to <0.56, 0.56, 0.56> but somewhere down to <-0.5, -0.707, -0.5>.

The code is:

Code: Select all

	while(device->run())
	{
		camera->setTarget ( core::vector3df(1,1,1));
		driver->beginScene(true, true, video::SColor(0,100,100,100));
		smgr->drawAll();

		// print camera data 
		if (font)
		{
			wchar_t text [100 + 1];
			swprintf (text, 100, L"Camera target: %f %f %f",
				camera->getTarget().X,
				camera->getTarget().Y,
				camera->getTarget().Z);

			font->draw(text, core::rect<s32>(130,10,300,50), video::SColor(255,255,255,255));
		}

		driver->endScene();
}
Post Reply