Skip to content

Added ability to change rotation up axis when ViewerCore::rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP - #2531

Open
villains wants to merge 6 commits into
libigl:mainfrom
villains:rotation_axis_up
Open

villains wants to merge 6 commits into
libigl:mainfrom
villains:rotation_axis_up

Conversation

@villains

@villains villains commented Feb 17, 2026

Copy link
Copy Markdown

This change allows you to set the direction of the up axis when ViewerCore::rotation_type is set to ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP. By default, the y-axis (0,1,0) is used as the up axis. However there are cases where it is more natural to work with the z-axis as the up axis. For example, when working with geoscientific data, the general convention is that x and y are the geographic coordinates, and z is the elevation. When viewing 3D datasets of this type, the most natural tendency is to rotate about the z-axis.

This PR implements the ability to choose the up axis when required.

Together with ViewerCore::camera_eye and ViewerCore::camera_up the initial 3D view can be configured to fit more naturally with geoscientific data.

Thank you for creating an excellent and easy to use (and integrate) 3D mesh library!

Checklist

  • All changes meet libigl style-guidelines.
  • Adds new .cpp file.
  • Adds corresponding unit test.
  • This is a minor change.

…pe == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP
…p-axis from working correctly. Fixed up code formatting to better match existing libigl code.
@alecjacobson

Copy link
Copy Markdown
Contributor

Seems fine to me. If CI passes, will merge.

This branch has not been deployed

No deployments
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