Unable to find the angle of rotation

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

Unable to find the angle of rotation

Postby upendtu » Wed Jun 21, 2017 2:24 am

Hi I am using forge Js and now I want to calculate the rotation angle but I am unable to understand from the Documentation.
Could you please help me In finding the rotation angle and store in variable ?

Example Like when Rotating the panorama then I want the angle when rotating the panorama.

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

Re: Unable to find the angle of rotation

Postby rroux » Wed Jun 21, 2017 8:05 am

Hi upendtu,

By angle of rotation I assume you are talking about the camera rotation?
Camera rotation are yaw and pitch values expressed in degrees.
Yaw is in -180 to 180 range. Pitch is in -90 to 90 range.
Yaw and pitch are equal to 0 at the center of your panorama.

You can access these values like this assuming your viewer instance is named viewer:

  1. var yaw = viewer.camera.yaw;
  2. var pitch = viewer.camera.pitch;


Hope this helps, have a nice day!
- Raphaël

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

Re: Unable to find the angle of rotation

Postby rroux » Wed Jun 21, 2017 8:42 am

You can see camera values in action in the "Toolbox" sample.
You have a camera section that will show you the camera rotation.
http://forgejs.org/samples/toolbox
- Raphaël

Who is online

Users browsing this forum: Bing [Bot] and 2 guests