Forum

Camera speed and altitude

25 November 2015 11:35 #5305
Hi,
Does someone knows how I can get camera altitude and translation speed to dynamically display it ( like flights instruments ) ?
http://fabkzo.com
25 November 2015 18:23 #5322
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).
Blend4Web Team
26 November 2015 11:51 #5348
Tnak you , I'll test it asap
http://fabkzo.com
 
Please register or log in to leave a reply.