updating camera position

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
databandit
Posts: 32
Joined: Tue Dec 21, 2004 11:36 am

updating camera position

Post by databandit »

hi
can anyone give me some code on how to get the camera's position every frame . . . . i know the getAbsolutePosition function . . . but I need to know how to do it every frame...

thanks
zubair
Guest

Post by Guest »

Every frame?

How about........putting it in the main loop? It loops through successive frames.

while(device->run()) {
BeginScene etc.
...
EndScene etc.
--> xyz = camera->GetAbsolutePosition etc.
}
databandit
Posts: 32
Joined: Tue Dec 21, 2004 11:36 am

Post by databandit »

Anonymous wrote:Every frame?

How about........putting it in the main loop? It loops through successive frames.

while(device->run()) {
BeginScene etc.
...
EndScene etc.
--> xyz = camera->GetAbsolutePosition etc.
}
cant it be used in another function too?
Guest

Post by Guest »

You can call it from anywhere where you can get access to the camera object.

If you have a global variable for the camera object you can access that variable in the OnPostRender function of any object (enemy node?) if you like.
Post Reply