1

Coin3D uses single-sided rendering by default like the image below:


(source: gitee.com)

How does open inventor / coin3d enable two-sided rendering like OpenGL?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
风何之
  • 43
  • 3

2 Answers2

3

SoShapeHints is the answer, but this summary may be clearer:

  • Two-sided lighting and backface culling are disabled by default.
  • Two-sided lighting: enabled if not solid and ordered vertices.
    Set vertexOrdering to COUNTERCLOCKWISE (usually) or CLOCKWISE.
  • Backface culling: enabled if solid and ordered vertices.
    Set shapeType to SOLID.
mike
  • 186
  • 3
0

You should add a SoShapeHints node before the geometry in the scenegraph either with shapeType set to UNKNOWN_SHAPE_TYPE if you already set the vertexOrdering to CLOCKWISE or COUNTERCLOCKWISE, or with the vertexOrdering set to UNKNOWN_ORDERING for any shape type, e.g.

ShapeHints {
    vertexOrdering UNKNOWN_ORDERING
    shapeType UNKNOWN_SHAPE_TYPE
}

For further explanation see the SoShapeHints documentation of Coin3D

vre
  • 6,041
  • 1
  • 25
  • 39