Skip to content

Feature: Add yaw camera support #2357

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

Merged

Conversation

Medyan-Naser
Copy link
Contributor

@Medyan-Naser Medyan-Naser commented Jul 3, 2025

Describe your changes

  • Added support for rotating the camera up and down using the elevation_camera function.
  • Bound the elevation_camera rotation to keys 2 (rotate 90°) and 8 (rotate -90°).
  • Implemented the azimuth_camera function but did not bind it to any key yet.
  • Added a new test for elevation_camera and azimuth_camera , including a baseline image for verification.
  • Updated documentation to cover the new camera rotation functions and key bindings.

Test logs

Medyans-MacBook-Air:f3d medyan$ ctest -R TestCommandScriptElevation
Test project /Users/medyan/Desktop/projects/open_source/f3d
Start 465: f3d::TestCommandScriptElevation
1/1 Test #465: f3d::TestCommandScriptElevation ... Passed 5.02 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 5.07 sec
Medyans-MacBook-Air:f3d medyan$

Medyans-MacBook-Air:f3d medyan$ ctest -R TestCommandScriptAzimuth
Test project /Users/medyan/Desktop/projects/open_source/f3d
Start 466: f3d::TestCommandScriptAzimuth
1/1 Test #466: f3d::TestCommandScriptAzimuth .... Passed 6.53 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) = 6.58 sec
Medyans-MacBook-Air:f3d medyan$

Issue ticket number and link if any

#2342

Checklist for finalizing the PR

  • I have performed a self-review of my code
  • I have added tests for new features and bugfixes
  • I have added documentation for new features
  • If it is a modifying the libf3d API, I have updated bindings
  • If it is a modifying the .github/workflows/versions.json, I have updated timestamp

Continuous integration

Please check the checkbox of the CI you want to run, then push again on your branch.

  • Style checks
  • Fast CI
  • Coverage cached CI
  • Analysis cached CI
  • WASM docker CI
  • Android docker CI
  • macOS Intel cached CI
  • macOS ARM cached CI
  • Windows cached CI
  • Linux cached CI
  • Other cached CI

@mwestphal
Copy link
Member

As fas as I can tell, azimuth_camera seems to be working as expected. yaw_camera does not yet. let me take a look.

@mwestphal
Copy link
Member

Well, I was wrong, the method we want to expose is not yaw, but elevation:

Yaw: Rotate the focal point about the view up vector, using the camera's position as the center of rotation.
Elevation: Rotate the camera about the cross product of the negative of the direction of projection and the view up vector, using the focal point as the center of rotation.

Sorry about the misdirection, please correct to use the elevation method instead.

@Medyan-Naser
Copy link
Contributor Author

to confirm you want "2" and "8" to be bound to elevation_camrea 90 and elevation_camera -90. Then just add a function for azimuth_camera but without binding it to any key.

@mwestphal
Copy link
Member

to confirm you want "2" and "8" to be bound to elevation_camrea 90 and elevation_camera -90. Then just add a function for azimuth_camera but without binding it to any key.

Yes! exactly.

Copy link

codecov bot commented Jul 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.17%. Comparing base (750cfc4) to head (89fed66).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2357      +/-   ##
==========================================
+ Coverage   96.13%   96.17%   +0.03%     
==========================================
  Files         131      133       +2     
  Lines       11951    12074     +123     
==========================================
+ Hits        11489    11612     +123     
  Misses        462      462              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Medyan-Naser
Copy link
Contributor Author

Hi @mwestphal , I believe the pull request is ready to be merged.

@mwestphal
Copy link
Member

Hi @mwestphal , I believe the pull request is ready to be merged.

I'll review :)

Copy link
Member

@mwestphal mwestphal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some changes needed

Copy link
Member

@mwestphal mwestphal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small changes needed

@mwestphal
Copy link
Member

Nice! I'll merge if CI comes back green.

@Medyan-Naser
Copy link
Contributor Author

Nice! I'll merge if CI comes back green.

It seems TestInteractionElevationCameraRotation is still failing. But after I commit the image that you generated, its passing for VTK 9.3 and less, but failing for VTK 9.4 and higher

@mwestphal
Copy link
Member

Alright, CI is clean! Merging!

@mwestphal mwestphal merged commit 97441b6 into f3d-app:master Jul 5, 2025
83 checks passed
@mwestphal
Copy link
Member

Thanks for your contribution @Medyan-Naser !

@Medyan-Naser Medyan-Naser deleted the feature/yaw-camera-support-2342 branch July 5, 2025 21:46
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