H3D API
2.4.1
|
Specialized field for automatically generating normals from coordinates. More...
#include <H3D/IndexedFaceSet.h>
Public Member Functions | |
virtual X3DNormalNode * | generateNormalsPerVertex (X3DCoordinateNode *_coord, const vector< int > &coord_index, bool _ccw, H3DFloat crease_angle) |
Create a new X3DNormalNode from the arguments given with one normal for each vertex specified by coord_index, i.e. More... | |
virtual X3DNormalNode * | generateNormalsPerVertex (X3DCoordinateNode *_coord, const vector< int > &coord_index, bool _ccw) |
Create a new X3DNormalNode from the arguments given with one normal for each vertex in coord. More... | |
virtual X3DNormalNode * | generateNormalsPerFace (X3DCoordinateNode *_coord, const vector< int > &coord_index, bool _ccw) |
Create a new X3DNormalNode from the arguments given with one normal for each face specified. More... | |
Additional Inherited Members | |
![]() | |
void | checkFieldType (Field *f, int index) |
Function for checking that a field is of a correct type given type specification according to the TypedField template arguments. More... | |
void | checkTemplateArguments () |
Function for checking that a field given TypedField type specification is valid. More... | |
Specialized field for automatically generating normals from coordinates.
The resulting Normal node will contain normals per face if normalPerVertex is false or creaseAngle <=0. if normalPerVertex is true, then the normals returned will be a normal per vertex in coord if creaseAngle >= pi and a normal per vertex specified with coordIndex if 0 < creaseAngle < pi
routes_in[0] is the normalPerVertex field. routes_in[1] is the coord field. routes_in[2] is the coordIndex field. routes_in[3] is the ccw field. routes_in[4] is the creaseAngle field.
|
virtual |
Create a new X3DNormalNode from the arguments given with one normal for each face specified.
_coord | Node with the coordinates. |
coord_index | The indices in coord for the vertices. |
_ccw | Defines the ordering of the vertex coordinates of the geometry with respect to generated normal vectors used in the lighting model equations. If ccw is TRUE, the normals shall follow the right hand rule; the orientation of each normal with respect to the vertices (taken in order) shall be such that the vertices appear to be oriented in a counterclockwise order when the vertices are viewed (in the local coordinate system of the Shape) from the opposite direction as the normal. |
References H3D::Normal::vector.
|
virtual |
Create a new X3DNormalNode from the arguments given with one normal for each vertex in coord.
The normal for each vertex will be the average of the normal of all faces using that vertex.
_coord | Node with the coordinates. |
coord_index | The indices in coord for the vertices. |
_ccw | Defines the ordering of the vertex coordinates of the geometry with respect to generated normal vectors used in the lighting model equations. If ccw is TRUE, the normals shall follow the right hand rule; the orientation of each normal with respect to the vertices (taken in order) shall be such that the vertices appear to be oriented in a counterclockwise order when the vertices are viewed (in the local coordinate system of the Shape) from the opposite direction as the normal. |
References H3D::X3DCoordinateNode::nrAvailableCoords(), H3DUtil::AutoRef< class >::reset(), and H3D::Normal::vector.
|
virtual |
Create a new X3DNormalNode from the arguments given with one normal for each vertex specified by coord_index, i.e.
the number of normals will be the number of non-(-1) values in coord_index.
_coord | Node with the coordinates. |
coord_index | The indices in coord for the vertices. |
_ccw | Defines the ordering of the vertex coordinates of the geometry with respect to generated normal vectors used in the lighting model equations. If ccw is TRUE, the normals shall follow the right hand rule; the orientation of each normal with respect to the vertices (taken in order) shall be such that the vertices appear to be oriented in a counterclockwise order when the vertices are viewed (in the local coordinate system of the Shape) from the opposite direction as the normal. |
crease_angle | If the angle between the geometric normals of two adjacent faces is less than the crease angle, normals are calculated so that the faces are shaded smoothly across the edge; otherwise, normals are calculated so that a lighting discontinuity across the edge is produced. |
References H3DCos(), H3D::X3DCoordinateNode::nrAvailableCoords(), H3DUtil::AutoRef< class >::reset(), and H3D::Normal::vector.