Forum

camera.target_set_distance jitter issue

17 August 2018 16:38
we use target_set_distance to make camera transitions on a target camera.
unfortunately, this function introduces a lot of jitter.

example Code:

var activeCamera = m_scenes.get_active_camera();
var distLerp = lerpVal(camRot_Start.dist, camRot_Dest.dist, smoothCamLerp);
m_cam.target_set_distance(activeCamera, distLerp);

var camPos = m_cam.get_translation(activeCamera);
var dist = m_vec3.length(camPos);
console.log("set" + distLerp + "/get" + dist)


the console Shows that the set value is smooth but the actual camera (get) distance is jittering:


set28.613917142836836/get28.410833540719945
set29.055030842741516/get29.699227582873487
set29.460213634360393/get29.221199341581016
set29.719593565351943/get30.21798734258391
set29.871931632295638/get29.525877408408068
set30.064900452741426/get30.603924072365288
set30.125723273970234/get29.64751985663909
set30.17289508107868/get30.698269757516055
set30.203529032666072/get29.708787781389383
set30.214199992706117/get30.719613791540695
set30.21588951551803/get29.712167325206092


why is this Happening and how can we avoid this Problem?

the example Code is executed in a function via m_main.set_render_callback

distance Limits are disabled
using blend4web 18.5.0

the Problem is very strong in firefox, less so in edge. but Overall pretty inconsistent in Magnitude. sometimes worse, sometimes not no bad.

issue persist when:
-disabling / enabling camera zoom
-using append_loop_cb
-changing zoom velocity in the blend file
 
Please register or log in to leave a reply.