SbProjector(3)
π SbProjector(3) β the manual page, bestie edition π
okay so this is a Library Functions Manual page, and the star of the show is SbProjector. welcome, come in, sit down, hydrate π«Ά
β¨ NAME β¨
SbProjector β the SbProjector class is the abstract base projector class. it's giving "template energy", it's giving "i don't do the work, my children do" π
πΈ SYNOPSIS πΈ
#include <Inventor/projectors/SbProjector.h>
Inherited by SbCylinderProjector, SbLineProjector, SbPlaneProjector, and SbSphereProjector. so like, it's the mother of a whole little projector dynasty π
π Public Member Functions
virtual SbVec3f project (const SbVec2f &point)=0
virtual void setViewVolume (const SbViewVolume &vol)
const SbViewVolume & getViewVolume (void) const
virtual void setWorkingSpace (const SbMatrix &space)
const SbMatrix & getWorkingSpace (void) const
virtual SbProjector * copy (void) const =0
virtual SbBool tryProject (const SbVec2f &point, const float epsilon,
SbVec3f &result)
π Protected Member Functions
SbProjector (void)
virtual ~SbProjector ()
SbLine getWorkingLine (const SbVec2f &point) const
float findVanishingDistance (void) const
SbBool verifyProjection (const SbVec3f &projpt) const
π Protected Attributes
SbViewVolume viewVol
SbMatrix worldToWorking
SbMatrix workingToWorld
π¦ Detailed Description π¦
The SbProjector class is the abstract base projector class. periodt. β¨
Projectors are used in the Coin library for mapping 2D coordinates (typically from the position of the mouse cursor in the rendering window) to 3D "world" coordinates. it's literally the glow-up machine that turns your flat little mouse coords into full 3D main character energy π
Mapping 2D coordinates to 3D coordinates is something which is done extensively in the dragger classes, to provide the user with a convenient and natural way of interacting with the 3D geometry of scenes. the draggers are obsessed with this technique ngl π
For a usage example, see the class documentation for SbSphereSheetProjector. go read it, it's iconic π
The application programmer should normally not need to care about the projector classes, unless there are special needs in the application. like, don't stress about it unless it's your moment π§
See also
SoDragger
π Constructor & Destructor Documentation π
SbProjector::SbProjector (void ) [protected]
The constructor initializes the workingspace matrix to an identity matrix. a clean slate, a fresh start, the beginning of a beautiful friendship π«Ά
virtual SbProjector::~SbProjector () [inline], [protected], [virtual]
Destructor is protected, as this is an abstract class. she's not for public consumption, bestie, she's abstract π
π₯ Member Function Documentation π₯
virtual SbVec3f SbProjector::project (const SbVec2f & point) [pure virtual]
Project the 2D point from normalized viewport coordinates to a 3D point. The mapping will be done in accordance with the type of the projector. it's the whole point of the whole class, no cap π₯
Implemented in SbCylinderPlaneProjector, SbCylinderProjector, SbCylinderSectionProjector, SbCylinderSheetProjector, SbLineProjector, SbPlaneProjector, SbSpherePlaneProjector, SbSphereSectionProjector, and SbSphereSheetProjector. look at all those overachievers β¨
void SbProjector::setViewVolume (const SbViewVolume & vol) [virtual]
Set the viewing volume the projections will take place in. it's the stage, and the projections are the performance π
See also
getViewVolume()
const SbViewVolume & SbProjector::getViewVolume (void ) const
Return the current viewing volume used by the projections.
See also
setViewVolume()
void SbProjector::setWorkingSpace (const SbMatrix & space) [virtual]
Sets the matrix used for converting from the projector's coordinate system to the world coordinate system. translation era π«
Reimplemented in SbCylinderProjector, and SbSphereProjector.
const SbMatrix & SbProjector::getWorkingSpace (void ) const
Returns projector-to-world matrix. she knows the way πΊοΈ
See also
setWorkingSpace()
virtual SbProjector * SbProjector::copy (void ) const [pure virtual]
Construct and return a copy of this projector. The caller is responsible for destructing the new instance. you made the copy, you clean up the copy, that's the rules π
β οΈ Note that if the Coin library has been built as a DLL under Microsoft Windows and you use this method from application code, you must make sure that both the Coin DLL and the application executable is using the same instance of a C Run-Time (CRT) library. Otherwise, you will get memory heap corruption upon deallocating the returned instances, eventually leading to mysterious crashes. bestie do NOT mix your CRT libraries, that's not a vibe, that's a disaster π
Implemented in SbCylinderPlaneProjector, SbCylinderSectionProjector, SbCylinderSheetProjector, SbLineProjector, SbPlaneProjector, SbSpherePlaneProjector, SbSphereSectionProjector, and SbSphereSheetProjector.
SbBool SbProjector::tryProject (const SbVec2f & point, const float epsilon, SbVec3f & result) [virtual]
Try projecting the 2D point from normalized viewport coordinates to a 3D point. The mapping will be done in accordance with the type of the projector. see the word "try"? yeah. she's cautious, she's careful, she's checking first π€
If the projection can't be done safely (for instance when the projection plane or line is parallel to the view volume projection), this function should return FALSE. no shame in saying no π«
Default implementation will call project() and always return TRUE, but subclasses can override this behavior to support safe projections.
Since Coin 3.0
Reimplemented in SbLineProjector, and SbPlaneProjector.
SbLine SbProjector::getWorkingLine (const SbVec2f & point) const [protected]
From the 2D point in normalized screenspace coordinates, calculate the line passing through the scene. π€οΈ
Typically used for tracking intersection points for the mouse cursor. she's following your every move, respectfully π±οΈπ
float SbProjector::findVanishingDistance (void ) const [protected]
Finds the unit cube vanishing distance for the current projector view volume. The view volume must be a perspective view volume. no perspective, no vanishing, sorry babes π
This method was not part of the Inventor v2.1 API, and is an extension specific to Coin. homegrown, artisanal, Coin-exclusive π
Since Coin 1.1
SbBool SbProjector::verifyProjection (const SbVec3f & projpt) const [protected]
Verifies that projpt is a valid projection for the current view volume. For perspective view volumes, it does this by checking that the projection point is in front of the eye plane. For orthographic projections, this method always returns TRUE. she's doing a vibe check on your projection point β
This method was not part of the Inventor v2.1 API, and is an extension specific to Coin.
Since Coin 1.1
π Member Data Documentation π
SbViewVolume SbProjector::viewVol [protected]
The viewVol definition. it is what it says on the tin, bestie π₯«
SbMatrix SbProjector::worldToWorking [protected]
The matrix which converts from world coordinates to coordinates in the projector's local coordinate system. going local, love that journey for her πβ‘οΈπ
SbMatrix SbProjector::workingToWorld [protected]
The matrix which converts from coordinates in the projector's local coordinate system to world coordinates. and now she's going global ππ β‘οΈπ
π«Ά Author π«Ά
Generated automatically by Doxygen for Coin from the source code. so technically nobody "wrote" this, it manifested. slay, automation β¨
okay that's the whole page!! you understood all of it, i'm so proud of you, go project some 3D points ππ
πΈ that was SbProjector(3), served fresh by Coin, Version 3.1.3 β mwah, catch you on the next manpage bestie π
π¦ where this page comes from
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 43: Coin3-devel 3.1.3-40.fc43 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- fedora 44: Coin3-devel 3.1.3-42.fc44 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms