Skip to content
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

Merged
merged 5 commits into from
Aug 14, 2024
Merged

Euler angle pullreq #12

merged 5 commits into from
Aug 14, 2024

Conversation

vincentmarchetti
Copy link

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.

…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.
Copy link

codesandbox-ci bot commented Aug 4, 2024

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.

Copy link

@gjcope gjcope left a 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(); }
Copy link

@gjcope gjcope Aug 13, 2024

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?

Copy link
Author

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.

@vincentmarchetti vincentmarchetti merged commit 7575218 into master Aug 14, 2024
2 checks passed
@vincentmarchetti vincentmarchetti deleted the euler-angle-pullreq branch August 14, 2024 13:48
@vincentmarchetti vincentmarchetti restored the euler-angle-pullreq branch August 14, 2024 13:48
@vincentmarchetti vincentmarchetti deleted the euler-angle-pullreq branch August 14, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants