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.
databandit
Posts: 32 Joined: Tue Dec 21, 2004 11:36 am
Post
by databandit » Thu Feb 10, 2005 1:22 pm
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 » Thu Feb 10, 2005 2:18 pm
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 » Thu Feb 10, 2005 2:21 pm
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 » Thu Feb 10, 2005 2:35 pm
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.