camera.onCameraChange Event

upendtu
Posts: 14
Joined: Wed Jun 21, 2017 2:21 am

camera.onCameraChange Event

Postby upendtu » Wed Aug 23, 2017 7:49 am

When I rotate panorama I am getting the angle using $scope.source_angle = viewerLeft.camera.yaw;
The problem is when I stopped the panorama it still increasing or decreasing the angle value.

What I want is when I stop the panorama rotation angle change should also stop at that point.

currently when I stop rotating pano it still updating the angle value in background for 2 - 3 seconds.

How I can get the stop event to stop changing angle after pano drag .

User avatar
bbaudel
ForgeJS Team
Posts: 35
Joined: Wed Oct 26, 2016 9:20 am

Re: camera.onCameraChange Event

Postby bbaudel » Fri Aug 25, 2017 8:05 am

Is it due to a latency with some console.log or something like that ?
I'll have a look on the way the event is fired too.
Thanks

upendtu
Posts: 14
Joined: Wed Jun 21, 2017 2:21 am

Re: camera.onCameraChange Event

Postby upendtu » Fri Aug 25, 2017 8:19 am

yes When I console.log(viewer.cameras.yaw)

its giving the value inside console even after I stopped panorama rotation.
it stop after some time like after 2 or 3 sec.

User avatar
bbaudel
ForgeJS Team
Posts: 35
Joined: Wed Oct 26, 2016 9:20 am

Re: camera.onCameraChange Event

Postby bbaudel » Fri Aug 25, 2017 12:48 pm

Ok so it's probably not an issue.
In this case the number of event is too big to be displayed when action is stopped and the console finalize it's "drawing" task after the stop. But the stop should be effective at the right time without any console.log in your code.
Is it the case if you remove all console.log ?
You can also track the code into the debugger console with the non-minifed version to see if a call is done after the stop.

upendtu
Posts: 14
Joined: Wed Jun 21, 2017 2:21 am

Re: camera.onCameraChange Event

Postby upendtu » Fri Aug 25, 2017 1:02 pm

Hi,
yes after removing all the console it still giving me output even after stop of panorama rotation.
I am passing this angle value to the arrow and when I stop rotating the panorama it still changing the angle of arrow for 2-3 sec.

What type of error this could.
Is there any event like stop the and rotation and stop calculating angle.
Or To put some sleep time when calling the angle in arrow ?

Please let me know how can I solve this ?

User avatar
bbaudel
ForgeJS Team
Posts: 35
Joined: Wed Oct 26, 2016 9:20 am

Re: camera.onCameraChange Event

Postby bbaudel » Wed Aug 30, 2017 12:57 pm

Hi,
I've tested with a simple project.
I cannot reproduce your latency on yaw changes.

Is it in screen mode or in VR mode ?

Do you have an online sample to see what can be wrong in your case ? Or you can send me the config.json file used on this project and the tracking code used to grab the viewer.camera.yaw value.

User avatar
rroux
ForgeJS Team
Posts: 126
Joined: Wed Oct 26, 2016 12:19 pm

Re: camera.onCameraChange Event

Postby rroux » Mon Sep 04, 2017 12:19 pm

When you move the camera with the mouse, there is an algorithm that slows down the movement after you release the mouse button.
At the end of the process the values are still changing during few seconds but you can't see it with your eyes because the change are very low.
It sounds like this to me. Hope this helps
- Raphaël

Who is online

Users browsing this forum: No registered users and 2 guests