Forum

Camera speed and altitude

25 November 2015 11:35
Hi,
Does someone knows how I can get camera altitude and translation speed to dynamically display it ( like flights instruments ) ?
25 November 2015 18:23
Hi!

Does someone knows how I can get camera altitude and translation speed to dynamically display it ( like flights instruments ) ?

1) Transform API allows to obtain camera position: get_translation(). The second coordinate (Y) is the altitude.

2) Translation speed needs some calculation. You can use set_render_callback() method. In this callback you'll have the amount of time elapsed since the application started and the amount of time elapsed from the previous frame. Here goes the calculation: (camera translation since the previous frame)/(time elapsed since the previous frame).
26 November 2015 11:51
Tnak you , I'll test it asap
 
Please register or log in to leave a reply.