This node is another of the eleven geometry and appearance property Nodes. The ShapeHints node determines whether IndexedFaceSets are solid, contain ordered vertices, or contain convex faces.
VERTEX ORDERING ENUMS UNKNOWN_ORDERING Ordering of vertices is unknown CLOCKWISE Face vertices are ordered clockwise (from the outside) COUNTERCLOCKWISE Face vertices are ordered counterclockwise (from the outside) SHAPE TYPE ENUMS UNKNOWN_SHAPE_TYPE Nothing is known about the shape SOLID The shape encloses a volume FACE TYPE ENUMS UNKNOWN_FACE_TYPE Nothing is known about faces CONVEX All faces are convex FILE FORMAT/DEFAULTS ShapeHints { vertexOrdering UNKNOWN_ORDERING # SFEnum shapeType UNKNOWN_SHAPE_TYPE # SFEnum faceType CONVEX # SFEnum creaseAngle 0.5 # SFFloat }
The ShapeHints node provides information that allows VRML to optimize certain rendering features. These optimizations include enabling back-face culling and disabling two-sided lighting. For example, if an object is solid and has ordered vertices, this node may turn on backface culling and turn off two-sided lighting. On the other hand, if the object is not solid but has ordered vertices, the node may turn off backface culling and turn on two-sided lighting.
Another point, this node also affects how default normals are generated. When an IndexedFaceSet is required to generate default normals, it will use the creaseAngle field to determine which edges should be smooth- shaded and which ones should have a sharp crease. A crease angle is defined as the angle between surface normals on adjacent polygons. For example, a crease angle of 0.5 radians means that an edge between two adjacent polygonal faces will be smooth shaded if the normals to the two faces form an angle that is less than 0.5 radians. The default value for the crease angle is 0.5 radians or about thirty degrees. Otherwise, the edge between the two adjacent polygonal faces will be faceted.
Example Use
The following code fragment is from Allnodes.wrl.
ShapeHints {
vertexOrdering UNKNOWN_ORDERING
shapeType UNKNOWN_SHAPE_TYPE
faceType CONVEX
creaseAngle 0.5
}