SOCAMERA(3iv)
β¨ NAME β¨
okay so SoCamera is the abstract base class for camera nodes, and that's the whole name vibe. π
𧬠INHERITS FROM π§¬
It inherits from SoBase > SoFieldContainer > SoNode > SoCamera. Like, that's its whole ancestry, bestie. π§¬
π SYNOPSIS π
First, the include and the iconic defines:
#include <Inventor/nodes/SoCamera.h>
#define SO_ASPECT_SQUARE 1.00
#define SO_ASPECT_VIDEO 1.333333333
#define SO_ASPECT_35mm_ACADEMY 1.371
#define SO_ASPECT_16mm 1.369
#define SO_ASPECT_35mm_FULL 1.33333
#define SO_ASPECT_70mm 2.287
#define SO_ASPECT_CINEMASCOPE 2.35
#define SO_ASPECT_HDTV 1.777777777
#define SO_ASPECT_PANAVISION 2.361
#define SO_ASPECT_35mm 1.5
#define SO_ASPECT_VISTAVISION 2.301
Then there's this enum ViewportMapping with these iconic options:
SoCamera::CROP_VIEWPORT_FILL_FRAMEβ Crops the viewport within the current window, so that the aspect ratio matches that of the camera. As the window size changes, the aspect ratio remains unchanged. The cropped region is drawn as a filled gray area. β¨SoCamera::CROP_VIEWPORT_LINE_FRAMEβ Crops the viewport, but draws a thin frame around the viewport. πSoCamera::CROP_VIEWPORT_NO_FRAMEβ Crops the viewport, but gives no visual feedback as to the viewport dimensions within the window. πSoCamera::ADJUST_CAMERAβ Adjusts the camera aspect ratio and height to make it fit within the given window. (The camera's fields are not affected, just the values sent to the graphics library.) πSoCamera::LEAVE_ALONEβ Do nothing. Camera image may become stretched out of proportion. π
Fields from class SoCamera:
SoSFEnum viewportMapping
SoSFVec3f position
SoSFRotation orientation
SoSFFloat aspectRatio
SoSFFloat nearDistance
SoSFFloat farDistance
SoSFFloat focalDistance
Methods from class SoCamera:
void pointAt(const SbVec3f &targetPoint)
virtual void scaleHeight(float scaleFactor)
virtual SbViewVolume getViewVolume(float useAspectRatio = 0.0) const
void viewAll(SoNode *sceneRoot, const SbViewportRegion
&vpRegion, float slack = 1.0)
void viewAll(SoPath *path, const SbViewportRegion
&vpRegion, float slack = 1.0)
SbViewportRegion getViewportBounds(const SbViewportRegion ®ion)
const
static SoType getClassTypeId()
Methods from class SoNode:
void setOverride(SbBool state)
SbBool isOverride() const
SoNode * copy(SbBool copyConnections = FALSE) const
virtual SbBool affectsState() const
static SoNode * getByName(const SbName &name)
static int getByName(const SbName &name, SoNodeList &list)
Methods from class SoFieldContainer:
void setToDefaults()
SbBool hasDefaultValues() const
SbBool fieldsAreEqual(const SoFieldContainer *fc) const
void copyFieldValues(const SoFieldContainer *fc, SbBool
copyConnections = FALSE)
SbBool set(const char *fieldDataString)
void get(SbString &fieldDataString)
virtual int getFields(SoFieldList &resultList) const
virtual SoField * getField(const SbName &fieldName) const
SbBool getFieldName(const SoField *field, SbName &fieldName)
const
SbBool isNotifyEnabled() const
SbBool enableNotify(SbBool flag)
Methods from class SoBase:
void ref()
void unref() const
void unrefNoDelete() const
void touch()
virtual SoType getTypeId() const
SbBool isOfType(SoType type) const
virtual void setName(const SbName &name)
virtual SbName getName() const
π DESCRIPTION π
okay so this is the abstract base class for ALL camera nodes. It's the blueprint that defines the common methods and fields every camera has. Cameras are literally how you view a scene. When a camera shows up during rendering, it sets the projection and viewing matrices and the viewport appropriately β it does NOT draw geometry. Not its job. π«
Cameras should be placed before any shape nodes or light nodes in a scene graph; otherwise those shapes or lights cannot be rendered properly. That's a warning, bestie. Also cameras are affected by the current transformation, so you can position a camera by placing a transformation node before it in the scene graph. The default position and orientation of a camera is at (0,0,1) looking along the negative z-axis. Periodt.
You can also use a node kit to create a camera; see the reference page for SoCameraKit. π
πΈ FIELDS πΈ
SoSFEnum viewportMappingβ Defines how to map the rendered image into the current viewport, when the aspect ratio of the camera differs from that of the viewport. πSoSFVec3f positionβ The location of the camera viewpoint. πSoSFRotation orientationβ The orientation of the camera viewpoint, defined as a rotation of the viewing direction from its default(0,0,-1)vector. πSoSFFloat aspectRatioβ The ratio of camera viewing width to height. This value must be greater than0.0. There are several standard camera aspect ratios defined inSoCamera.h. πSoSFFloat nearDistanceandSoSFFloat farDistanceβ The distance from the camera viewpoint to the near and far clipping planes. βοΈSoSFFloat focalDistanceβ The distance from the viewpoint to the point of focus. This is typically ignored during rendering, but may be used by some viewers to define a point of interest. π
π¦ METHODS π¦
void pointAt(const SbVec3f &targetPoint)β Sets the orientation of the camera so that it points toward the given target point while keeping the "up" direction of the camera parallel to the positive y-axis. If this is not possible, it uses the positive z-axis as "up." π―virtual void scaleHeight(float scaleFactor)β Scales the height of the camera. Perspective cameras scale theirheightAnglefields, and orthographic cameras scale theirheightfields. πvirtual SbViewVolume getViewVolume(float useAspectRatio = 0.0) constβ Returns a view volume structure, based on the camera's viewing parameters. If theuseAspectRatioargument is not0.0(the default), the camera uses that ratio instead of the one it has. πvoid viewAll(SoNode *sceneRoot, const SbViewportRegion &vpRegion, float slack = 1.0)andvoid viewAll(SoPath *path, const SbViewportRegion &vpRegion, float slack = 1.0)β Sets the camera to view the scene rooted by the given node or defined by the given path. The near and far clipping planes will be positionedslackbounding sphere radii away from the bounding box's center. A value of1.0will make the clipping planes the tightest around the bounding sphere. πSbViewportRegion getViewportBounds(const SbViewportRegion ®ion) constβ Returns the viewport region this camera would use to render into the given viewport region, accounting for cropping. πΌοΈstatic SoType getClassTypeId()β Returns type identifier for this class. π
π FILE FORMAT/DEFAULTS π
This is an abstract class, so there's no format or default values here. Check the reference page of a derived class for that, bestie. π
π SEE ALSO π
SoOrthographicCamera, SoPerspectiveCamera, SoCameraKit β go check them out, they're iconic. β¨
and that's the whole manual page for SoCamera(3IV)(). The footer says SoCamera(3IV)() so you know it's official. byeee π
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms