SBSPHEREPLANEPROJECTOR(3iv)

πŸ’– SbSpherePlaneProjector β€” sphere-plane projector πŸ’–

okay bestie, gather round, we're talking about SbSpherePlaneProjector from the 3IV manual, and honestly? it's giving ✨ geometry royalty ✨


🌸 NAME 🌸

SbSpherePlaneProjector β€” a sphere-plane projector, no cap πŸ’…


πŸ¦‹ INHERITS FROM πŸ¦‹

the family tree is long, bestie, and she's at the bottom of it:

SbProjector > SbSphereProjector > SbSphereSectionProjector >
SbSpherePlaneProjector

so she inherits everything from all those ancestors above her. generational wealth, fr fr πŸ‘‘


✨ SYNOPSIS ✨

#include <Inventor/projectors/SbSpherePlaneProjector.h>

πŸŽ€ Methods from class SbSpherePlaneProjector

these are the ones she brought to the party herself:

SbSpherePlaneProjector(float edgeTol = .9, SbBool orientToEye = TRUE)
SbSpherePlaneProjector(const SbSphere &sph, float edgeTol = .9,
     SbBool orientToEye = TRUE)
~SbSpherePlaneProjector()

πŸ’œ Methods from class SbSphereSectionProjector

inherited, but still iconic:

void                setTolerance(float edgeTol)
float               getTolerance() const
void                setRadialFactor(float radialFactor = 0.0)
float               getRadialFactor() const
SbBool              isWithinTolerance(const SbVec3f &point)

🌈 Methods from class SbSphereProjector

more inheritance, more slay:

SbVec3f             projectAndGetRotation(const SbVec2f &point, SbRotation &rot)
virtual SbRotation  getRotation(const SbVec3f &point1, const SbVec3f &point2)
void                setSphere(const SbSphere &sph)
const SbSphere &    getSphere() const
void                setOrientToEye(SbBool orientToEye)
SbBool              isOrientToEye() const
void                setFront(SbBool isFront)
SbBool              isFront() const
SbBool              isPointInFront(const SbVec3f &point) const

⭐ Methods from class SbProjector

the OGs at the top of the tree:

virtual SbVec3f        project(const SbVec2f &point)
virtual void           setViewVolume(const SbViewVolume &vol)
const SbViewVolume &   getViewVolume() const
virtual void           setWorkingSpace(const SbMatrix &space)
const SbMatrix &       getWorkingSpace() const
virtual SbProjector *  copy() const

🌼 DESCRIPTION 🌼

so the whole vibe of SbSpherePlaneProjector is this: you take a window space point (usually wherever the mouse is at, iykyk πŸ–±οΈ) and you project it onto a surface that's defined by a sphere plus a plane cutting through that sphere. it's giving "two worlds colliding" πŸ’«

two projected points together can produce a rotation about the sphere's center. and here's the cute part β€” when the mouse position projects onto the plane, the rotations happen as if the plane is being dragged, which makes the sphere roll beneath it. the way that it just rolls?? obsessed 😭

incremental changes (delta rotation) can be computed during interactive sessions. sphere projectors are typically used to write interactive 3D manipulators and viewers β€” so like, if you're building a viewer, this is your girl 🫢


πŸ’… METHODS πŸ’…

  • SbSpherePlaneProjector(float edgeTol = .9, SbBool orientToEye = TRUE)
  • SbSpherePlaneProjector(const SbSphere &sph, float edgeTol = .9, SbBool orientToEye = TRUE)

constructors, babes ✨ the first one uses a default sphere centered at the origin with radius 1.0. the sphere gets supplied in the second one, so if you already have one, hand it over.

the position of the plane is specified as a fraction of the sphere radius, using the parameter edgeTol. here's the tea on the numbers:

  • a tolerance value of 1.0 positions the plane down the center of the sphere
  • a tolerance value of 0.5 defines the longitudinal plane halfway between the center and the outside edge of the sphere
  • the default value is .9, so that almost half the sphere is in front of the plane πŸ“

the orientToEye parameter decides whether the plane is perpendicular to the eye, or perpendicular to the sphere's Z axis. setting that parameter to TRUE (the default, bestie, it's already set for you) specifies that the plane be perpendicular to the eye, which is most often the desired behavior. like, that's the one you want 9 times outta 10 πŸ’–

also important: the default view volume is undefined, and the working space is identity. don't come for me, that's just what it is πŸ™ˆ
  • ~SbSpherePlaneProjector()

destructor. she's done, she's leaving, we stan a clean exit πŸ‘‹


πŸ‘‘ SEE ALSO πŸ‘‘

go check out her cousins, they're all iconic in their own way:

  • SbCylinderProjector
  • SbCylinderPlaneProjector
  • SbCylinderSectionProjector
  • SbCylinderSheetProjector
  • SbLineProjector
  • SbPlaneProjector
  • SbSphereSheetProjector

and that's the whole page, bestie πŸŽ€ this was SbSpherePlaneProjector(3IV) β€” yes, the source/version tag is literally just the same name all over again, SbSpherePlaneProjector(3IV)(), and the date slot is a whole mood of "trust me, it's fine" 🌈 no date, no drama. periodt πŸ’œ