I’m trying the Zoom To Box but it seems to rotate the view (specifically, the view’s camera angle) if I don’t have Camera Parallel Projection checked. This is the same whether the view is set to a 2D or a 3D view. To test this behavior, first make sure that Camera Parallel Projection is checked. Then create a Wavelet source and then use the Zoom To Box feature to zoom into a corner or the Wavelet source (make sure that the view is set to a 3D view though, more on that below). This changes the view’s camera angle and results in an image like:
This does rotation during zoom doesn’t seem like the behavior that users would expect.
Now, for when switching from 3D view mode to 2D view mode – if Camera Parallel Projection isn’t checked when the switch to 2D from 3D view mode it looks like the view switches to Camera Parallel Projection is enabled, even though that option isn’t checked. Enabling and disabling the Camera Parallel Projection while in 2D view mode after doing the above will show the difference. Is this a bug?
This is all for PV v5.11 straight from the download site on a MacOS.
HI Andy and Alan,
Yes it appears to rotate in the first case you identified. When it is a 3D image and the Zoom to Box is selected, if Camera Parallel Projection is not checked, the image will rotate. The way that I verified this is that the Orientation Axes does move as well. If the Camera Parallel Projection is checked, and the above procedure is performed, then the image does not rotate.
You are correct that rotation during a zoom operation dose not seam like a behavior that the user would expect.
Wen I tested the second part of your question, it did not operate the way I would expect it to. However, you are going from a 3D mesh to a 2D mesh and the image stayed stable(in rotation) from eyeballing it. It does change shape when the Camera Parallel Projection checkbox is toggled, and you have a 2D representation, which was unexpected from my view point. This may be a bug.
When selecting the 3D view, I do expect it to change when the Camera Parallel Projection is toggled.
I think the problem is that is is acting correctly (with the exception of the rotation) when the 3D view is selected and incorrectly when the 2D view is selected.
Do you agree with my assessment Andy? Or am I missing something here?
Hi Andy and Phil,
I want to ponder this one. Please don’t write it up. I am pretty sure that ParaView is actually doing the right thing. I will say that the matrix stack in 3d graphics is amazingly complicated, and I struggled to ever understand it. Especially when going into perspective projection (i.e., non orthographic projection or what we are calling Parallel Projection off). Then, to add complexity, zooming into a spot where the eye (where all the lines come together) isn’t the center of your zoom.
I don’t think the camera or actor are being rotated. Instead, perspective projection causes edges of the bounding box that move away from the camera to become foreshortened (i.e., shorter than their true length) as well as angled away from the focal point unless they are on the line between the eye and aim points.
Once you have used Zoom to Box, try panning the camera and you should see that as you move the corner of the box to the center of the view that the foreshortening more pronounced until – when the bounding box corner is at the view center – the edges perpendicular to the focal plane become zero-length. (This will make the view look like the image with parallel-projection turned on; but only when you pan the camera to place the bounding box corner precisely at the view center.)
If it was up to me, I would leave Zoom to Box feature alone. Getting it to work right is a lot harder than it sounds. And I mean a whole lot harder. It took us years to get the behavior to work in projection mode.
Zooming to a region in perspective project is not a simple pan and zoom. Panning the camera makes the box projections on the near and far planes misaligned, so it becomes impossible to see the region through all depths.
I’m not entirely sure what is done to the camera, but I’m sure it is necessary to align it to the frustum defined by the box selection. I see @Andy_Bauer’s point about the camera angle getting unexpectedly turned after a zoom and then reset, but it is a minor inconvenience that is not fixable.
I was thinking that if I were to try a fix to the changing camera angle/rotation during zoom to box what I would do is calculate the current view direction (the vector pointing from the camera position to the view’s center. Then use this same view direction once I’m zoomed in to the desired zoom location. I believe that this would prevent the rotation. It may have other undesired effects or just be incredibly painful (or impossible) to implement.
Another thing I just noticed is that if I use the zoom to box and then go back and do a reset view that I get a different view from where I started from. For example, click on the +x view direction, then use zoom to box, then do reset – the X with outward pointing normals. I would think that this should return me to my original camera settings for the view but it doesn’t.
In the end though I can go to a 2D view with camera parallel projection, use the zoom to box and I get my desired behavior of a non-rotated view. So since I can do what I want, unfortunately by more steps than I’d like, I’m fine with leaving as is if this is deemed too much effort to change.
I’m in agreement with Dave Thompson and Ken Moreland. Even if the current implementation is incorrect, I worry the risk by far outweighs the benefit. As Ken said, we worked on getting this “right” for years.
Also, with regards to 2d, I believe it is not correct mixing 2d and 3d. Taking a 3d object and turning it into a 2d object and then back to a 3d object. that still has a z component can’t be risk free… But hey, if it works…