-
in web Sample APPUI-> Viewport Frontstage |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Please define what you mean by "I want the current view not changed." Toggling the camera by definition changes the view, because it switches between an orthographic projection and a perspective projection. |
Beta Was this translation helpful? Give feedback.
-
As Paul says, toggling the camera on and off necessarily changes the viewing volume. That process is not deterministic, since views with "camera off" effectively have the camera positioned at infinity and when we turn "camera on" we have to infer a camera position based on the contents of the scene. Perhaps an illustration of what happens will help. Let's say you start with the camera on with this view: on the left is what the user sees. On the right shows the camera position and lens angle shown by the dot and the blue lines. The green line is the "focus plane", that would be the what the camera would be focused on in real life (things closer and farther than that plane would be out-of-focus). Note that you can't see anything behind the camera, and the width of the view is very small close to the camera and very large in the distance. If you ask to turn the camera off, the result is to move the camera back to infinity, but keep the width the same on the focus plane: Note that the image the user sees can be quite different. Then, if you ask to turn the camera back on, we keep the same lens angle and focal length, but we have to figure out a camera position. We do that by taking a portion of the visible area in the center of the screen and "guessing" what you're looking at (the closest and farthest visible geometry) and then positioning the camera so you see that: that sometimes doesn't show the same volume as you started with. If you then turn the camera back off, we get: at this point, turning the camera on and off tends to not change much. HTH |
Beta Was this translation helpful? Give feedback.
As Paul says, toggling the camera on and off necessarily changes the viewing volume. That process is not deterministic, since views with "camera off" effectively have the camera positioned at infinity and when we turn "camera on" we have to infer a camera position based on the contents of the scene. Perhaps an illustration of what happens will help.
Let's say you start with the camera on with this view:
on the left is what the user sees. On the right shows the camera position and lens angle shown by the dot and the blue lines. The green line is the "focus plane", that would be the what the camera would be focused on in real life (things closer and farther than that plane would be out-of-…