public class SoViewport extends SoNode
The view volume specified by the current camera will be mapped into this region of the render target (e.g. the viewer window). By default Open Inventor manages the viewport to be the entire render target, even if the window (for example) is resized. So this node is useful for rendering objects in a specific part of the window, for example screen locked annotation graphics like legends and a "compass".
Remember that the camera node's viewportMapping field is set to ADJUST_CAMERA by default. In this mode the camera automatically adjusts its view volume to have the same aspect ratio as the viewport (widening for example) to avoid distorting shapes in the scene. But note that the camera will compare the aspect ratio of its view volume to the aspect ratio of the viewport that is in effect when the camera node is traversed. So it's generally better to create a camera for each viewport and make sure the camera node is traversed after the viewport node. If using multiple viewports with the same camera, generally the viewports should all have the aspect ratio.
Tip: You can use the
SoDepthBuffer node to clear the depth buffer in the viewport region to ensure annotation graphics render correctly. However, in general, you should put an
SoViewportClipping node before this node to limit the effect of the depth buffer clear to the desired viewport.
If you want to place multiple "views" inside the same window, consider the
PoSceneView nodes. Views allow the application to specify multiple cameras, each with its own separate viewport Views can be used, for example, to subdivide the window into multiple independent views of a 3D scene or to create an inset "bird's eye" view inside the window, without the overhead of creating separate windows. The advantage of using the view nodes over
SoViewport is that when mouse event locations are mapped back into 3D space, Open Inventor automatically uses the view volume of the camera associated with the view node whose viewport currently contains the mouse cursor.
|Modifier and Type||Field and Description|
Specifies the position of the viewport in pixels.
Specifies the size of the viewport in pixels.
|Constructor and Description|
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public final SoSFVec2f origin
public final SoSFVec2f size
Generated on March 25, 2020, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com