-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Euler angle pullreq #12
Conversation
…implements the specification that the 3 x,y,z properties in the RotateTransform are to be interpreted as euler angle rotations (measure in degrees), to be interpreted in the intrinsic axis order XYZ
which is a low precision test that the resulting camera orientation met the visual requirements. THe plan is to add more exacting tests.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
@@ -18,5 +18,7 @@ export class RotateTransform extends Transform { | |||
} | |||
return retVal; | |||
} | |||
|
|||
get Rotation() : object { return this.getRotation(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but curious of the utility - is this to keep with an accessor standard in the rest of the codebase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the existing code for Presentation 3 manifests uses getPropertyName() for accessors, so the 3D extensions provides this as well. As a personal preference I prefer the .PropertyName accessor, so I added this for Rotation. Admittedly this is inconsistent and does puff up the source code a bit.
Added a function eulerFromRotateTransform which returns a Threejs object EulerAngle obtained from a IIIF-3D RotateTransform instance under convention that the angles are in degrees and are to be interpreted as instrinsic rotations in the XYZ order. This order is the default ThreeJS ordering but is explicitly specified in the code for documentation purpose.