Skip to content

Order of parse_camera matters #1546

@nicolemarsaglia

Description

@nicolemarsaglia
Contributor

Depending on camera params set, if done in a particular order, could break the camera we pass to VTK-m/Viskores.

Examples: I have a slice along the y-axis. I adjust the camera elevation to be 90, the camera does not automatically adjust the up, so I also set this to be [0,0,1].

Here is what happens to the camera we pass to VTK-m depending on the order we parse the input camera params and apply them to each render's (VTK-m) camera.

Elevation is 90 and not setting up:

Camera: 3D
  LookAt: [-5.5,-10,-5.5]
  Pos   : [-5.5,2.7279224395752,-5.5]
  Up    : [0,1,0] //UH OH!!!!! 
  FOV   : 60
  Clip  : [1.27279222011566..127.279220581055]
  XyZ   : 0 0 1
 PM: 
1.73205065727234 0 0 0
0 1.73205065727234 0 0
0 0 -1.0202020406723 -2.57129740715027
0 0 -1 0
 VM: 
-nan -nan -nan nan
-nan -nan -nan nan
0 1 0 -2.7279224395752
0 0 0 1

Elevation is 90 and set up before elevation in parse_camera:

Camera: 3D
  LookAt: [-5.5,-10,-5.5]
  Pos   : [-nan,-nan,-nan]
  Up    : [0,0,1]
  FOV   : 60
  Clip  : [1.27279222011566..127.279220581055]
  XyZ   : 0 0 1
 PM: 
1.73205065727234 0 0 0
0 1.73205065727234 0 0
0 0 -1.0202020406723 -2.57129740715027
0 0 -1 0
 VM: 
-nan -nan -nan nan
-nan -nan -nan nan
-nan -nan -nan nan
0 0 0 1

Elevation is 90 and set up after elevation in parse_camera:

Camera: 3D
  LookAt: [-5.5,-10,-5.5]
  Pos   : [-5.5,2.7279224395752,-5.5]
  Up    : [0,0,1]
  FOV   : 60
  Clip  : [1.27279222011566..127.279220581055]
  XyZ   : 0 0 1
 PM: 
1.73205065727234 0 0 0
0 1.73205065727234 0 0
0 0 -1.0202020406723 -2.57129740715027
0 0 -1 0
 VM: 
-1 0 0 -5.5
0 0 1 5.5
0 1 0 -2.7279224395752
0 0 0 1

parse_camera(const conduit::Node camera_node, vtkm::rendering::Camera &camera)

Fix: parse and add the params that adjust the position of the camera before the params that are based off of position.

Activity

JustinPrivitera

JustinPrivitera commented on Jun 4, 2025

@JustinPrivitera
Member

This reminds me of this, although I didn't read too closely: visit-dav/visit#17923 (comment)

nicolemarsaglia

nicolemarsaglia commented on Jun 13, 2025

@nicolemarsaglia
ContributorAuthor

will be resolved by #1547

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @nicolemarsaglia@JustinPrivitera

      Issue actions

        Order of parse_camera matters · Issue #1546 · Alpine-DAV/ascent