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 ) ?
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!
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).
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).