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.
TJBaldy
Posts: 16 Joined: Fri Dec 02, 2011 3:06 pm
Post
by TJBaldy » Thu Jan 19, 2012 5:14 pm
Thought it would be simple enough but my code doesn't work.
This is what I've got;
if(maya_camera)
{
maya_camera->setPosition(core::vector3df(4000,4000,4000));
maya_camera->setTarget(core::vector3df(target));
}
The idea is to be a "from sky view" camera looking at my level. It's probably really easy and I'm being stupid...
Thanks in advance
Last edited by
TJBaldy on Thu Jan 19, 2012 6:23 pm, edited 1 time in total.
smso
Posts: 246 Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong
Post
by smso » Thu Jan 19, 2012 5:21 pm
The camera 's up vector should lie on the horizontal plane for it to look down from above.
Regards from smso
TJBaldy
Posts: 16 Joined: Fri Dec 02, 2011 3:06 pm
Post
by TJBaldy » Thu Jan 19, 2012 5:24 pm
Well I thought setting my target to my node (3D model on the level) would make the camera look down towards it. Instead, the camera just positions itself next to the node and doesn't start in the sky looking down.
And could you elaborate on your comment please?
Thanks, Tom
hendu
Posts: 2600 Joined: Sat Dec 18, 2010 12:53 pm
Post
by hendu » Thu Jan 19, 2012 5:34 pm
The Maya cam is weird like that, you can't control its precise position. It picks a position based on the target and zoom.
TJBaldy
Posts: 16 Joined: Fri Dec 02, 2011 3:06 pm
Post
by TJBaldy » Thu Jan 19, 2012 6:22 pm
hendu wrote: The Maya cam is weird like that, you can't control its precise position. It picks a position based on the target and zoom.
Thanks, your advice fixed the problem. I've just changed the maya camera to a FPS camera and now my code works exaclty as I wanted
.
Kudos!