Get Roll value of [Edit Current Viewpoint]

By Xiaodong Liang

There is a parameter roll in UI [Edit Current Viewpoint]. It means rotating the camera around its front-to-back axis. A positive value rotates the camera counterclockwise, and a negative value rotates it clockwise.

Screen Shot 2019-07-28 at 3.45.34 PM

Screen Shot 2019-07-28 at 3.45.53 PM

In API perspective, a rotation around world axes (WCS) is configured by Viewpoint.Rotation (Rotation3D) which is in 3D space defined as a quaternion. From quaternion, it can also tell something like roll, yaw, pitch. One post kindly provides the mathematical equations:

https://answers.unity.com/questions/416169/finding-pitchrollyaw-from-quaternions.html

These are defined in aircraft principal axes. In Navisworks space,  when the up vector is Y+, right vector is X+, and view direction is Z-, the roll can be calculated from quaternion (Viewpoint.Rotation) by the equations above. However, in other cases when the up vector is different, roll in UI means what it indicates: rotating the camera around its front-to-back axis. Unfortunately, I do not find any…

Read more