SoNormalGenerator(3)
π SoNormalGenerator(3) β Coin π
okay bestie, pull up a chair, we're doing SoNormalGenerator(3) from the Coin manual today and honestly? she's a baddie. this is the class that generates normals. that's the whole vibe. π
β¨ NAME β¨
SoNormalGenerator β The SoNormalGenerator class is used to generate normals.
like. that's it. that's her job. normals. generated. iconic behavior. π
π¦ SYNOPSIS π¦
#include <include/Inventor/misc/SoNormalGenerator.h>
πΈ Public Member Functions πΈ
SoNormalGenerator (const SbBool ccw, const int approxVertices=64)
~SoNormalGenerator ()
void reset (const SbBool ccw)
void beginPolygon ()
void polygonVertex (const SbVec3f &v)
void endPolygon ()
void triangle (const SbVec3f &v0, const SbVec3f &v1, const SbVec3f &v2)
void quad (const SbVec3f &v0, const SbVec3f &v1, const SbVec3f &v2,
const SbVec3f &v3)
void generate (const float creaseAngle, const int32_t *striplens=NULL,
const int numstrips=0)
void generatePerStrip (const int32_t *striplens, const int numstrips)
void generatePerFace (void)
void generateOverall (void)
int getNumNormals () const
void setNumNormals (const int num)
const SbVec3f * getNormals () const
const SbVec3f & getNormal (const int32_t i) const
void setNormal (const int32_t index, const SbVec3f &normal)
π Detailed Description π
The SoNormalGenerator class is used to generate normals.
FIXME: document properly β no cap, that's literally what it says. the maintainers left us a lil sticky note and honestly? respect the honesty. π
π Constructor & Destructor Documentation π
β SoNormalGenerator::SoNormalGenerator (const SbBool isccw, const int approxVertices = 64)
Constructor with isccw indicating if polygons are specified in counterclockwise order. The approxVertices can be used to optimize normal generation.
(quick note bestie β the synopsis calls that first param ccw, the docs call it isccw. same energy, don't @ me, i'm just reporting the tea. π)
β SoNormalGenerator::~SoNormalGenerator ()
Destructor. she's done, she's logging off, she's going home. π«Ά
π Member Function Documentation π
β¨ void SoNormalGenerator::reset (const SbBool ccwarg)
Resets the normal generator, making it possible to reuse it without allocating a new one. sustainability queen π±
This function is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.
Since
Coin 2.0
β¨ void SoNormalGenerator::beginPolygon (void )
Signals the start of a new polygon.
See also
SoNormalGenerator::polygonVertex()SoNormalGenerator::endPolygon()
β¨ void SoNormalGenerator::polygonVertex (const SbVec3f & v)
Adds a vertex to the current polygon.
See also
SoNormalGenerator::beginPolygon()SoNormalGenerator::endPolygon()
β¨ void SoNormalGenerator::endPolygon (void )
Signals the end of a polygon.
See also
SoNormalGenerator::beginPolygon()SoNormalGenerator::polygonVertex()
β¨ void SoNormalGenerator::triangle (const SbVec3f & v0, const SbVec3f & v1, const SbVec3f & v2)
Convenience method for adding a triangle. three points, one shape, zero stress. πΊ
β¨ void SoNormalGenerator::quad (const SbVec3f & v0, const SbVec3f & v1, const SbVec3f & v2, const SbVec3f & v3)
Convenience method for adding a quad
(four points this time. she's generous. π)
β¨ void SoNormalGenerator::generate (const float creaseAngle, const int32_t * striplens = NULL, const int numstrips = 0)
Triggers the normal generation. Normals are generated using creaseAngle to find which edges should be flat-shaded and which should be smooth-shaded.
If normals are generated for triangle strips, the striplens and numstrips must be supplied. See src/nodes/SoTriangleStripSet.cpp (generateDefaultNormals()) for an example on how you send triangle strip information to this generator. It's not trivial, since you have to know how OpenGL/Coin generate triangles from triangle strips.
not trivial. they said it, not me. read that example file, bestie, i'm begging. π
β¨ void SoNormalGenerator::generatePerStrip (const int32_t * striplens, const int numstrips)
Generates one normal per strip by averaging face normals. one normal, one strip, average it out, slay. π
β¨ void SoNormalGenerator::generatePerFace (void )
Generates the normals per face. Use this when PER_FACE normal binding is needed. This method is not part of the OIV API.
β¨ void SoNormalGenerator::generateOverall (void )
Generates one overall normal by averaging all face normals. Use when normal binding is OVERALL. This method is not part of the OIV API.
β¨ int SoNormalGenerator::getNumNormals (void ) const
Returns the number of normals generated.
β¨ void SoNormalGenerator::setNumNormals (const int num)
Sets the number of generated normals. This method is not supported in Coin, and is provided for API compatibility only.
heads up: not supported in Coin. it exists purely for API compatibility. it will not be doing the thing you think it's doing. π
β¨ const SbVec3f * SoNormalGenerator::getNormals (void ) const
Returns a pointer to the generated normals.
β¨ const SbVec3f & SoNormalGenerator::getNormal (const int32_t i) const
Returns the normal at index i.
See also
SoNormalGenerator::getNumNormals()
β¨ void SoNormalGenerator::setNormal (const int32_t index, const SbVec3f & normal)
Sets the normal at index index to normal. This method is not supported in Coin, and is provided for API compatibility only.
same warning, same energy: not supported in Coin, API compatibility only. π«
π Author π
Generated automatically by Doxygen for Coin from the source code.
(so nobody wrote this, a robot did, and honestly? the robot ate. π)
and that's the whole page, bestie!! Version 4.0.10, dated Thu Jun 25 2026 00:00:00, filed under SoNormalGenerator(3). go generate some normals, you absolute icon. πβ¨ππ¦πΈ
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms