detect current position

i have a program where i can move around the scene using arrow keys. Now i need to detect the current position of x, y and z.

which means, everytime i move, the program will return the value of x, y and z.

anybody can help, pleaseeee…

Keep track of …

a) where you start (x,y,z)

b) your displacement values for each movement (dx ,dy ,dz)

add the displacement to the start position each time you move and you’ll know where you are…

not many other ways to do it I’m afraid.

thanks for your suggestion. i’ll give it a try.