ascent icon indicating copy to clipboard operation
ascent copied to clipboard

Order of parse_camera matters

Open nicolemarsaglia opened this issue 10 months ago • 3 comments

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

https://github.com/Alpine-DAV/ascent/blob/d441993b357f310dbdf844abc85c3da10264ef99/src/libs/ascent/runtimes/flow_filters/ascent_runtime_conduit_to_vtkm_parsing.cpp#L93

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

nicolemarsaglia avatar Jun 04 '25 22:06 nicolemarsaglia

This reminds me of this, although I didn't read too closely: https://github.com/visit-dav/visit/issues/17923#issuecomment-1201773100

JustinPrivitera avatar Jun 04 '25 23:06 JustinPrivitera

will be resolved by #1547

nicolemarsaglia avatar Jun 13 '25 23:06 nicolemarsaglia

As part of this we should figure out the right way to set up during elevate transform.

cyrush avatar Sep 18 '25 21:09 cyrush